int object

Debashish Saha silideba at gmail.com
Sat Apr 28 02:42:14 EDT 2012


Notebook
Actions
Cell
Actions
Format
Output
Insert
Move
Run
Autoindent:
Kernel
Actions
Kill kernel upon exit:
Help
Python IPython Links
NumPy SciPy
MPL SymPy
run selected cell Shift-Enter :
run selected cell in-place Ctrl-Enter :
show keyboard shortcuts Ctrl-m h :
Configuration
Tooltip on tab:
Smart completer:
milliseconds Time before tooltip :
In [4]:

impor

from __future__ import division

from numpy import*

import numpy as np

import matplotlib.pyplot as plt

from scipy.special import jv

from scipy.special import yn





h_cross=1

m=1

E=np.linspace(0.1,10,100)



V0=-100

R=2

K=(2*E)**0.5

K_P=(2*(E-V0))**0.5









'''r=np.linspace(-10,10,1000)

def V(r):

   if r>0 and r<R:

       return V0

   return 0

V=np.vectorize(V)

ax.set_ylim(-200,10)

plt.plot(r,V(r))'''





def sph_jv(l,r):

    return (pi/(2*r))**0.5*jv(l+0.5,r)







def sph_yn(l,r):

    return (pi/(2*r))**0.5*yn(l+0.5,r)





def delta_l(K,l):

    K_P=(2*(E-V0))**0.5

    K=(2*E)**0.5

    sph_jv_P=(l*sph_jv(l,K*R)/(K*R))-sph_jv(l,K*R)

    sph_yn_P=(l*sph_yn(l,K*R)/(K*R))-sph_yn(l,K*R)

    Beta_l=l-(K_P*R(sph_jv(l+1,K_P*R))/(sph_jv(l,K_P*R)))

    return arctan((K*R*sph_jv_P-Beta_l*sph_jv(l,K*R))/(K*R*sph_yn_P-Beta_l*sph_yn(l,K*R)))





delta_l=np.vectorize(delta_l)



print delta_l(K,0)





---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/deba/<ipython-input-4-e1d59e6e732b> in <module>()
     49 delta_l=np.vectorize(delta_l)
     50
---> 51 print delta_l(K,0)
     52

/home/deba/epd-7.2-1-rh5-x86_64/lib/python2.7/site-packages/numpy/lib/function_base.pyc
in __call__(self, *args)
   1860             for arg in args:
   1861                 newargs.append(asarray(arg).flat[0])
-> 1862             theout = self.thefunc(*newargs)
   1863             if isinstance(theout, tuple):
   1864                 self.nout = len(theout)

/home/deba/<ipython-input-4-e1d59e6e732b> in delta_l(K, l)
     43     sph_jv_P=(l*sph_jv(l,K*R)/(K*R))-sph_jv(l,K*R)
     44     sph_yn_P=(l*sph_yn(l,K*R)/(K*R))-sph_yn(l,K*R)
---> 45     Beta_l=l-(K_P*R(sph_jv(l+1,K_P*R))/(sph_jv(l,K_P*R)))
     46     return
arctan((K*R*sph_jv_P-Beta_l*sph_jv(l,K*R))/(K*R*sph_yn_P-Beta_l*sph_yn(l,K*R)))
     47

TypeError: 'int' object is not callable



More information about the Python-list mailing list