Computational Physics

4223 days ago by comphy

# MATHEMATICAL METHODS OF Science and Engineering # FORTRAN codes / Matlab codes #http://www.uprh.edu/rbaretti #http://www.uprh.edu/rbaretti/Methodsoftheoreticalphysics.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart2.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart3.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart4.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart5.htm # Lectures on Quantum Mechanics http://www1.uprh.edu/rbaretti/LQMIntro.htm # http://www1.uprh.edu/rbaretti/LQMch1.htm #http://www1.uprh.edu/rbaretti/LQMch2.htm # http://www1.uprh.edu/rbaretti/LQMch3.htm # http://www1.uprh.edu/rbaretti/LQMch4.htm # http://www1.uprh.edu/rbaretti/LQMch5.htm #.. 
       
alfa=0.1 ; beta= 0.1; u=(1/2)*x^2+alfa*x^3+beta*x^4; plot(u,x,-2.5,2.5) 
       

                                
                            

                                
psi(r)=(1/pi^(1/2))*exp(-r) integral((1/r^3)*psi(r)^2*4*pi*r^2,r,0,oo) 
       
Traceback (click to the left of this block for traceback)
...
ValueError: Integral is divergent.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_5.py", line 6, in <module>
    integral((_sage_const_1 /r**_sage_const_3 )*psi(r)**_sage_const_2 *_sage_const_4 *pi*r**_sage_const_2 ,r,_sage_const_0 ,oo)
  File "", line 1, in <module>
    
  File "/sage/sage/local/lib/python2.6/site-packages/sage/misc/functional.py", line 568, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 6097, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:25344)
  File "/sage/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 597, in integral
    raise ValueError, "Integral is divergent."
ValueError: Integral is divergent.
s,t=var('s,t') integral(s*exp(s*t),s,0,1) 
       
(t - 1)*e^t/t^2 + 1/t^2
(t - 1)*e^t/t^2 + 1/t^2