NUMERICAL METHODS of Quantum Mechanics

265 days ago by reibaretti

# MATHEMATICAL METHODS OF Science and Engineering # Lectures on Quantum Mechanics #http://www1.uprh.edu/rbaretti #http://www1.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 
       
sage: g = Bessel(2); g J_{2} sage: print g J-Bessel function of order 2 sage: g.plot(0,10) 
       
J-Bessel function of order 2
J-Bessel function of order 2
a=2/3 print n(a) 
       
0.666666666666667
0.666666666666667
print n(pi) 
       
3.14159265358979
3.14159265358979
var('y,x'); integral(y*exp(-y),y) 
       
-(y + 1)*e^(-y)
-(y + 1)*e^(-y)
var('x,y'); f=(1+x*y)*sin(y); integral(f,y,0,x) 
       
Traceback (click to the left of this block for traceback)
...
Is  x  positive, negative, or zero?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sage/sagenb/sage_notebook/worksheets/reibaretti/1/code/2.py", line 8, in <module>
    integral(f,y,_sage_const_0 ,x)
  File "", line 1, in <module>
    
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/misc/functional.py", line 416, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 5962, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:24542)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 566, in integral
    result = expression._maxima_().integrate(v, a, b)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2003, in integral
    return I(var, min, max)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1390, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1298, in function_call
    return self.new(s)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1094, in new
    return self(code)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1029, in __call__
    return cls(self, x, name=name)
  File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1433, in __init__
    raise TypeError, x
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(x>0)' before integral or limit evaluation, for example):
Is  x  positive, negative, or zero?
f(x)= x*(sin(x)-x*cos(x))-cos(x) +1 ; diff(f,x) 
       
x |--> x^2*sin(x) - x*cos(x) + 2*sin(x)
x |--> x^2*sin(x) - x*cos(x) + 2*sin(x)
var('x'); f2=x-1/2; integral(f2^2,x,0,1) 
       
1/12
1/12
phi1=(12)^(1/2)*(x-1/2);integral(phi1^2,x,0,1) 
       
1
1
f2=x^2; phi0=1; phi1=(12)^(1/2)*(x-1/2); #integral(f2*phi0,x,0,1) phi2=x^2-(1/3)*phi0-(sqrt(3)/6)*phi1; #phi2=sqrt(540/23)*(x^2-(1/3)*phi0-(1/(6*sqrt(3)))*phi1 ); #integral(phi1*phi2,x,0,1) phi2=sqrt(180)*(x^2-(sqrt(3)/6)*phi1-1/3); integral(phi1*phi2,x,0,1) 
       
0
0
a=1/6*sqrt(3); n(a) 
       
0.288675134594813
0.288675134594813
#data g0,g1,g2 ,t0,t1,t2/8.,14.,8.,0.,50.,100./ var('t');g0=8;g1=14;g2=8;t0=0;t1=50;t2=100; gama=g0*(t-t1)*(t-t2)/((t0-t1)*(t0-t2))+g1*(t-t0)*(t-t2)/((t1-t0)*(t1-t2))+g2*(t-t0)*(t-t1)/((t2-t0)*(t2-t1)); y=plot(gama,t,0,100) show(y) 
       
var('r'); integral(4*pi*exp(-2*r)*r^2,r,0,oo) 
       
pi
pi
s,t=var('s,t') x(s)=exp(-s) integral(x(s)*exp(s*t),t,0,1) 
       
-e^(-s)/s + 1/s
-e^(-s)/s + 1/s
f(x)=(1/x)*(1 - exp(-x) ) ,p0(x) = 1; p1(x)= x; p2(x)=(1/2)*(3*x^2-1) 
       
line 3
SyntaxError: keyword can't be an expression (, line 3)
line 3
SyntaxError: keyword can't be an expression (, line 3)
var('Z'); assume(Z>0); phi(r)=(Z^3/pi)^(1/2)*exp(-Z*r); integral(4*pi*r^4*phi(r)^2,r,0,oo) 
       
3/Z^2
3/Z^2
var('r,theta');assume(r>0); #f(theta)=(1/(pi*r))*(1-cos(theta))^(-1/2); f(theta)=1/(pi*r)*(1-cos(theta))^(-1/2); delta=pi/180; integral(f(theta),theta,delta,pi) 
       
integrate(1/sqrt(-cos(theta) + 1), theta, 1/180*pi, pi)/(pi*r)
integrate(1/sqrt(-cos(theta) + 1), theta, 1/180*pi, pi)/(pi*r)
var('Z,r'); assume (Z>0); v(r)=1/r - ( Z +1/r )*exp(-2*Z*r); phi1s(r)=(Z^3/pi)^(1/2)*exp(-Z*r); phi2s(r)=(Z^3/(32*pi))^(1/2)*(2 - Z*r )*exp(-Z*r/2); integral(phi1s(r)*phi2s(r)*v(r)*4*pi*r^2,r,0,oo) 
       
4096/64827*sqrt(2)*Z
4096/64827*sqrt(2)*Z
var('Z,r1,r2'); assume (Z>0);assume(r1>0); phi1s(r)=(Z^3/pi)^(1/2)*exp(-Z*r); phi2s(r)=(Z^3/(32*pi))^(1/2)*(2 - Z*r )*exp(-Z*r/2); va=(1/r1)*integral(phi2s(r)^2*4*pi*r^2,r,0,r1) #va vb=integral(phi2s(r)^2*4*pi*r,r,r1,oo) #vb J=integral(phi1s(r1)^2*(va+vb)*4*pi*r1^2,r1,0,oo) J 
       
Traceback (click to the left of this block for traceback)
...
Is  r1  positive, negative, or zero?
Traceback (most recent call last):    vb=integral(phi2s(r)^2*4*pi*r,r,r1,oo)
  File "/usr/local/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 "/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 637, in integral
    result = expression._maxima_().integrate(v, a, b)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2025, in integral
    return I(var, min, max)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1404, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1312, in function_call
    return self.new(s)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1096, in new
    return self(code)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1031, in __call__
    return cls(self, x, name=name)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1447, in __init__
    raise TypeError, x
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(r1>0)' before integral or limit evaluation, for example):
Is  r1  positive, negative, or zero?
 
       
-1/8*((Z^4*r1^4 + 4*Z^2*r1^2 + 8*Z*r1 + 8)*e^(-Z*r1)/Z^3 - 8/Z^3)*Z^3/r1
-1/8*((Z^4*r1^4 + 4*Z^2*r1^2 + 8*Z*r1 + 8)*e^(-Z*r1)/Z^3 - 8/Z^3)*Z^3/r1
var('Z,r1,r2'); assume (Z>0);assume(r1>0); phi1s(r)=(Z^3/pi)^(1/2)*exp(-Z*r); phi2s(r)=(Z^3/(32*pi))^(1/2)*(2 - Z*r )*exp(-Z*r/2); va=-(1/8)*((Z^4*r^4 + 4*Z^2*r^2 + 8*Z*r + 8)*e^(-Z*r)/Z^3 - 8/Z^3)*Z^3/r ; vb= (1/8)*(Z^3*r^3 - Z^2*r^2 + 2*Z*r + 2)*Z*e^(-Z*r);v=va+vb; J=integral(phi1s(r)*phi2s(r)*v*4*pi*r^2,r,0,oo) J 
       
512/84375*sqrt(2)*Z
512/84375*sqrt(2)*Z
n( 512*sqrt(2)/84375) 
       
0.00858165740960029
0.00858165740960029
var('z'); assume(r1>0);assume(Z>0); phi1s=(Z^3/pi)^(1/2)*exp(-Z*r); phi2s=(Z^3/(32*pi))^(1/2)*(2 - Z*r )*exp(-Z*r/2); va=(1/r1)*integral(4*pi*r^2*phi1s,r,0,r1) va #vb(r)= integral(4*pi*r1*phi1s(r1)^2,r1,r,oo); #J1s1s=integral(phi1s(r)^2*(va(r)+vb(r))*4*pi*r^2,r,0,oo) #J1s1s va 
       
Traceback (click to the left of this block for traceback)
...
Is  r1  positive, negative, or zero?
Traceback (most recent call last):    va
  File "/usr/local/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 "/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 637, in integral
    result = expression._maxima_().integrate(v, a, b)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2025, in integral
    return I(var, min, max)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1404, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1312, in function_call
    return self.new(s)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1096, in new
    return self(code)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1031, in __call__
    return cls(self, x, name=name)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1447, in __init__
    raise TypeError, x
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(r1>0)' before integral or limit evaluation, for example):
Is  r1  positive, negative, or zero?
var('z r');assume(z>0); phi2p=(z^5/(96*pi))^(1/2)*r*exp(-z*r/2); integral(phi2p^2*4*pi*r^2,r,0,oo); 
       
1
1
var('z r1 r'); assume(z>0); phi1s=(z^3/pi)^(1/2)*exp(-z*r);phi2p=(z^5/(96*pi))^(1/2)*r*exp(-z*r/2); phi2s=(z^3/(32*pi))^(1/2)*(2 - z*r )*exp(-z*r/2); va=(1/r1)*integral(4*pi*r^2*phi2p^2,r,0,r1); #vb= integral(4*pi*r*phi2p^2,r,r1,oo); #phi1s=(z^3/pi)^(1/2)*exp(-z*r1); #integral((va+vb)*4*pi*r1^2,r1,0,oo); va 
       
Traceback (click to the left of this block for traceback)
...
Is  r1  positive, negative, or zero?
Traceback (most recent call last):    #phi1s=(z^3/pi)^(1/2)*exp(-z*r1);
  File "/usr/local/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 "/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 637, in integral
    result = expression._maxima_().integrate(v, a, b)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2025, in integral
    return I(var, min, max)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1404, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1312, in function_call
    return self.new(s)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1096, in new
    return self(code)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1031, in __call__
    return cls(self, x, name=name)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1447, in __init__
    raise TypeError, x
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(r1>0)' before integral or limit evaluation, for example):
Is  r1  positive, negative, or zero?
var('a'); assume(a>0); integral(exp(-x^2/a),x,0,oo) 
       
1/2*sqrt(pi)*sqrt(a)
1/2*sqrt(pi)*sqrt(a)
n( (1/2)*sqrt(pi)) 
       
0.886226925452758
0.886226925452758
(2/sqrt(pi))*integral(exp(-x^2),x,0,oo) 
       
1
1
# exchange term K(1s,2s) var('z ,r1, r'); assume(z>0); assume(r1>0); phi1s=(z^3/pi)^(1/2)*exp(-z*r); phi2p=(z^5/(96*pi))^(1/2)*r*exp(-z*r/2); phi2s=(z^3/(32*pi))^(1/2)*(2 - z*r )*exp(-z*r/2); va=(1/r1)*integral(4*pi*r^2*phi1s*phi2s,r,0,r1) va #vb= integral(4*pi*r*phi1s*phi2s,r,r1,oo); #phi1s=(z^3/pi)^(1/2)*exp(-z*r1);phi2p=(z^5/(96*pi))^(1/2)*r1*exp(-z*r1/2); #phi2s=(z^3/(32*pi))^(1/2)*(2 - z*r1 )*exp(-z*r1/2); #assume(r1>0); #integral(phi1s*phi2s*(va+vb)*4*pi*r1^2,r1,0,oo) 
       
Traceback (click to the left of this block for traceback)
...
Is  r1  positive, negative, or zero?
Traceback (most recent call last):    va
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/functional.py", line 687, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 6495, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:25927)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 824, in integral
    result = expression._maxima_().integrate(v, a, b)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2058, in integral
    return I(var, min, max)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1408, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1316, in function_call
    return self.new(s)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1097, in new
    return self(code)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1032, in __call__
    return cls(self, x, name=name)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1451, in __init__
    raise TypeError, x
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(r1>0)' before integral or limit evaluation, for example):
Is  r1  positive, negative, or zero?
var('a');Z=2; E = ( a^2 /2 -Z* a) + (1/4) *( a^2 /2 -Z*a) + (17/81)* a -(16/729)* a; y=plot(E,a,1.4,2.2) show(y) 
       
n(112/2187) 
       
0.0512117055326932
0.0512117055326932
var('a');z=3; E =(9/4)* ( a^2 /2 - z* a) +(5/8)*a + 2 *(17/81)*a -(16/729)* a ; y=plot(E,a,2.0,3.1) show(y) 
       
var('a1 a2 r1 r'); #assume(a1>0); #assume(a2>0); assume (r>0); assume(r1>0); phi1s(r)=(a1^3/pi)^(1/2)*exp(-a1*r); phi2s(r)=(a2^3/(32*pi))^(1/2)*(2 - a2*r )*exp(-a2*r/2); va(r1)=(1/r1)*integral(4*pi*r^2*phi2s(r)^2,r,0,r1) vb(r1)= integral(4*pi*r*phi2s(r)^2,r,r1,oo); integral(phi1s(r)^2*(va(r)+vb(r))*4*pi*r^2,r,0,oo) 
       
(8*a1^4*a2 + 20*a1^3*a2^2 + 12*a1^2*a2^3 + 10*a1*a2^4 +
a2^5)*a1^3/(32*a1^7 + 80*a1^6*a2 + 80*a1^5*a2^2 + 40*a1^4*a2^3 +
10*a1^3*a2^4 + a1^2*a2^5)
(8*a1^4*a2 + 20*a1^3*a2^2 + 12*a1^2*a2^3 + 10*a1*a2^4 + a2^5)*a1^3/(32*a1^7 + 80*a1^6*a2 + 80*a1^5*a2^2 + 40*a1^4*a2^3 + 10*a1^3*a2^4 + a1^2*a2^5)
var(' a2 '); z=3; a1=z-5/16; j1s1s=(5/8)*a1; k1s2s=-(16/729)*a1; j1s2s(a2)=(8*a1**4*a2 + 20*a1**3*a2**2 + 12*a1**2*a2**3 +10*a1*a2**4 +a2**5)*a1**3/(32*a1**7 + 80*a1**6*a2 + 80*a1**5*a2**2 + 40*a1**4*a2**3 +10*a1**3*a2**4 + a1**2*a2**5); e0(a2)=2.*(a1**2/2.-z*a1)+(1./4.)*(a2**2/2.-z*a2); E=e0(a2) +j1s1s+2.*j1s2s(a2)+k1s2s; y=plot(E,a2,.8,2.0); show(y) 
       
var('a'); Z=4; E= (5/2)*( a^2 /2 - Z*a)+ (5/8)*a +4*(17/81)*a +(77/512)*a - 2*(16/729)*a ; y=plot(E,a,2.6,4); show(y) 
       
var('a1 a2 r1 r'); # integral of J(2s,2s) #assume(a2>0); assume (r>0); assume(r1>0); phi1s(r)=(a1^3/pi)^(1/2)*exp(-a1*r); phi2s(r)=(a2^3/(32*pi))^(1/2)*(2 - a2*r )*exp(-a2*r/2); va(r1)=(1/r1)*integral(4*pi*r^2*phi2s(r)^2,r,0,r1) vb(r1)= integral(4*pi*r*phi2s(r)^2,r,r1,oo); integral(phi1s(r)^2*(va(r)+vb(r))*4*pi*r^2,r,0,oo) 
       
Traceback (click to the left of this block for traceback)
...
Is  a2  positive, negative, or zero?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_2.py", line 14, in <module>
    __tmp__=var("r1"); vb = symbolic_expression(integral(_sage_const_4 *pi*r*phi2s(r)**_sage_const_2 ,r,r1,oo)).function(r1);
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/functional.py", line 687, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 6495, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:25927)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 824, in integral
    result = expression._maxima_().integrate(v, a, b)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2058, in integral
    return I(var, min, max)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1408, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1316, in function_call
    return self.new(s)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1097, in new
    return self(code)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1032, in __call__
    return cls(self, x, name=name)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1451, in __init__
    raise TypeError, x
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(a2>0)' before integral or limit evaluation, for example):
Is  a2  positive, negative, or zero?
var('a2'); Z=4;a1=Z-5/16; j1s2s(a2)=(8*a1**4*a2 + 20*a1**3*a2**2 + 12*a1**2*a2**3 +10*a1*a2**4 +a2**5)*a1**3/(32*a1**7 + 80*a1**6*a2 + 80*a1**5*a2**2 + 40*a1**4*a2**3 +10*a1**3*a2**4 + a1**2*a2**5); E= 2*( a1^2 /2 - Z*a1)+ 2*(1/4)*( a2^2 /2 - Z*a2)+(5/8)*a1 +4*j1s2s(a2) +(77/512)*a2 - 2*(16/729)*a1 ; y=plot(E,a2,1.0,3.0); show(y) 
       
var('a2'); Z=4;a1=Z-5/16; j1s2s(a2)=(8*a1**4*a2 + 20*a1**3*a2**2 + 12*a1**2*a2**3 +10*a1*a2**4 +a2**5)*a1**3/(32*a1**7 + 80*a1**6*a2 + 80*a1**5*a2**2 + 40*a1**4*a2**3 +10*a1**3*a2**4 + a1**2*a2**5); E= 2*( a1^2 /2 - Z*a1)+ (1)*(1/4)*( a2^2 /2 - Z*a2)+(5/8)*a1 +2*j1s2s(a2) +0.*(77/512)*a2 - 1*(16/729)*a1 ; y=plot(E,a2,2,3); show(y) 
       
var('Z,r'); Z=2; #V=(1/r)*(1-exp(-2*Z*r) ) - Z*exp(-2*Z*r);  V=r; y=plot(V,r,1,4); show(y) 
       
Traceback (click to the left of this block for traceback)
...
SyntaxError: Non-ASCII character '\xc2' in file
/tmp/tmpjLDYm8/___code___.py on line 4, but no encoding declared; see
http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):    Z=2;
  File "", line 1, in <module>
    
  File "/tmp/tmpjLDYm8/___code___.py", line 4
SyntaxError: Non-ASCII character '\xc2' in file /tmp/tmpjLDYm8/___code___.py on line 4, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
var('r');Z=2; v=(1/r)*(1-exp(-2*Z*r) ) - Z*exp(-2*Z*r); y=plot(v,r,0.0001,5); show(y) 
       
var ('x'); V(x) = -0.0066*x**3 + 0.0967*x**2 - 0.4768*x + 0.975; y=plot(V(x),x,0,5); show(y) 
       
var('a ,z'); assume(z>0); assume(a>0); f1(x)=(4*z^3)^(1/2)*x*exp(-z*x); f2(x)=(8*z/5)^(1/2)*(1-(3*z/4)*x)*exp(-z*x/2); #integral(f1(x)*f2(x),x,0,oo) d2f2(x)=diff(f2(x),x,2); #d2f1(x)=diff(f1(x),x,2); #integral(f1(x)*(-1/2)*d2f1(x),x,0,oo) #integral((-z/x)*f1(x)^2,x,0,oo) integral(f2(x)*(-1/2)*d2f2(x),x,0,oo) 
       
-11/40*z^2
-11/40*z^2
var('a'); assume (a>0); f1(x)=2*x*exp(-x); f2(x)=(1/8^(1/2))*(2-x)*x*exp(-x/2); integral(f2(x)^2,x,0,oo) 
       
1
1
k(x)=-(1/2)*diff(f1(x),x,2) -(1/x)*f1(x) 
       
-x*e^(-x)
-x*e^(-x)
var ('x'); f1(x) = 2*x*exp(-x); f2(x)=(1/8^(1/2))*(2-x)*x*exp(-x/2) y=plot(f2(x),x,0,16); show(y) 
       
var('x,a'); assume(a>0); #f(x)=exp(-x^2)/(1+x^2); f(x)=exp(-x^4); integral(f(x),x,-1,+1) 
       
-1/2*I*gamma_incomplete(1/4, 1) + 1/2*I*gamma(1/4)
-1/2*I*gamma_incomplete(1/4, 1) + 1/2*I*gamma(1/4)
k=9E9 ; sigma=1/k; pia=3.1416 integral(k*sigma*2*pia*r/(1.1^2+r^2)^(1/2),r,0,10) 
       
56.2994706006
56.2994706006
n(6.2832*sqrt(101) - 6.2832) 
       
56.8621785026268
56.8621785026268
n(-(56.29-56.86)/.1) 
       
5.70000000000000
5.70000000000000
var(' a'); assume(a>0); f(x)=1/(1+a*x^2); integral(f(x),x,-oo,oo); 
       
pi/sqrt(a)
pi/sqrt(a)
var('a b c'); f(x)=x^3 +2*a*x^2+b*x +c; d2f(x)= diff(f(x),x,2); x=1; d2f(x) 
       
4*a + 6
4*a + 6
integrate(exp(-y^2)/(1+y^2)^(1/2),y,-oo,oo) 
       
integrate(e^(-y^2)/sqrt(y^2 + 1), y, -Infinity, +Infinity)
integrate(e^(-y^2)/sqrt(y^2 + 1), y, -Infinity, +Infinity)
% fortran !f90 do i=1,5 print*,'float(i)',float(i) enddo 
       
Traceback (click to the left of this block for traceback)
...
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_5.py", line 9, in <module>
    open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" + _support_.preparse_worksheet_cell(base64.b64decode("JSBmb3J0cmFuCiFmOTAKZG8gIGk9MSw1CnByaW50KiwnZmxvYXQoaSknLGZsb2F0KGkpCmVuZGRv"),globals())+"\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpOu6Si0/___code___.py", line 3
    % fortran
    ^
SyntaxError: invalid syntax
%fortran C FILE: FIB1.F SUBROUTINE FIB(A,N) C C CALCULATE FIRST N FIBONACCI NUMBERS C INTEGER N REAL*8 A(N) DO I=1,N IF (I.EQ.1) THEN A(I) = 0.0D0 ELSEIF (I.EQ.2) THEN A(I) = 1.0D0 ELSE A(I) = A(I-1) + A(I-2) ENDIF ENDDO END C END FILE FIB1.F 
       
Traceback (click to the left of this block for traceback)
...
OSError: [Errno 2] No such file or directory: 'fortran_module_1.so'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/f2py/f2py2e.py", line 557, in main
    run_compile()
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/f2py/f2py2e.py", line 543, in run_compile
    setup(ext_modules = [ext])
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/distutils/core.py", line 184, in setup
    return old_setup(**new_attr)
  File "/usr/local/sage2/local/lib/python/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/sage2/local/lib/python/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/local/sage2/local/lib/python/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/distutils/command/build.py", line 37, in run
    old_build.run(self)
  File "/usr/local/sage2/local/lib/python/distutils/command/build.py", line 134, in run
    self.run_command(cmd_name)
  File "/usr/local/sage2/local/lib/python/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/local/sage2/local/lib/python/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/distutils/command/build_src.py", line 130, in run
    self.build_sources()
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/distutils/command/build_src.py", line 147, in build_sources
    self.build_extension_sources(ext)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/distutils/command/build_src.py", line 256, in build_extension_sources
    sources = self.f2py_sources(sources, ext)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/distutils/command/build_src.py", line 514, in f2py_sources
    ['-m',ext_name]+f_sources)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/f2py/f2py2e.py", line 338, in run_main
    postlist=callcrackfortran(files,options)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/f2py/f2py2e.py", line 276, in callcrackfortran
    postlist=crackfortran.crackfortran(files)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/f2py/crackfortran.py", line 2683, in crackfortran
    readfortrancode(files,crackline)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/numpy/f2py/crackfortran.py", line 346, in readfortrancode
    'this code is in fix form?\n\tline=%s' % `l`)
Exception: readfortrancode: Found non-(space,digit) char in the first column.
	Are you sure that this code is in fix form?
	line='SUBROUTINE FIB(A,N)'

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_6.py", line 26, in <module>
    C END FILE FIB1.F''', '/sagenb/sagenb/sage_notebook.sagenb/home/reibaretti/42/cells/54')
  File "/usr/local/sage2/sagenb-0.7.4/src/sagenb/sagenb/misc/support.py", line 473, in syseval
    return system.eval(cmd, sage_globals, locals = sage_globals)
  File "/usr/local/sage2/local/lib/python2.6/site-packages/sage/misc/inline_fortran.py", line 92, in eval
    os.unlink(name + '.so')
OSError: [Errno 2] No such file or directory: 'fortran_module_1.so'
f(x)=x^2*e^(-3*x^3)/(1+x) a=0 b=infinity integrate(f,a,b) 
       
integrate(x^2*e^(-3*x^3)/(x + 1), x, 0, +Infinity)
integrate(x^2*e^(-3*x^3)/(x + 1), x, 0, +Infinity)
f(x)=x^2*exp(-x^2)/(1+x^2) a=0 b=5 print integrate(f(x),x,a,b) 
       
integrate(x^2*e^(-x^2)/(x^2 + 1), x, 0, 5)
integrate(x^2*e^(-x^2)/(x^2 + 1), x, 0, 5)
var('p, a') assume(p>0) assume (a>0) f(r)=exp(-a*r)*sin(p*r) integrate(f(r),r,0,oo) 
       
p/(a^2 + p^2)
p/(a^2 + p^2)
#(2.**(3./2.)/pi)/(p**2+1.)**2 f(p)=(2^(3/2)/pi)/(p^2+1)^2 tk=(1/2)*p^2 integrate(4*pi*p^2*tk*f(p)^2,p,0,oo) 
       
1/2
1/2
n(5/(4*pi)) 
       
0.397887357729738
0.397887357729738
f(p)=(2^(3/2)/pi)/(p^2+1)^2 tk=(1/2)*p^2 integrate(4*pi*p^2*f(p)^2,p,0,oo) 
       
1
1
var('Z,p') assume(Z>0) assume(p>0) f(r)= 4*pi*(Z^3/pi )^(1/2)*(sin(p*r) /p)* exp(-Z*r)*r #integrate(f(r),r,0,oo) fp(p)=8*sqrt(pi)*Z^(5/2)/(Z^4 + 2*Z^2*p^2 + p^4) integrate(4*pi*p^2*fp(p)^2,p,0,oo) 
       
8*pi^3
8*pi^3
var('Z,p') assume(Z>0) fp(p)=8*sqrt(pi)*Z^(5/2)/(Z^4 + 2*Z^2*p^2 + p^4) integrate(4*pi*p^2*fp(p)^2,p,0,oo) 
       
8*pi^3
8*pi^3
n(8*pi^3) 
       
248.050213442399
248.050213442399
var('x,y'); v(x,y)=x^2 + 3*x*y^2; ex(x,y)=-diff(v(x,y),x); x=1; y=2; ex(x,y) 
       
-14
-14
f(p)=exp(-p^2); integral(f(p)^2*4*pi*p^2,p,0,oo) 
       
1/4*pi^(3/2)*sqrt(2)
1/4*pi^(3/2)*sqrt(2)
f(p)= (2/pi)^(3/4)*exp(-p^2) integral(f(p)^2*4*pi*p^2,p,0,oo) 
       
1
1
g2(p)=exp(-2*p^2) g1n(p)=(2/pi)^(3/4)*exp(-p^2) integral(g2(p)*g1n(p)*4*pi*p^2,p,0,oo) 
       
1/9*pi^(3/4)*2^(3/4)*sqrt(3)
1/9*pi^(3/4)*2^(3/4)*sqrt(3)
g2(p)=exp(-2*p^2) g1n(p)=(2/pi)^(3/4)*exp(-p^2) u2(p)=g2(p)-(1/9)*pi^(3/4)*2^(3/4)*sqrt(3)*g1n(p) #integral(u2(p)*g1n(p)*4*pi*p^2,p,0,oo) integral(u2(p)^2*4*pi*p^2,p,0,oo) 
       
1/432*(27*sqrt(2) - 32)*pi^(3/2)*sqrt(2)
1/432*(27*sqrt(2) - 32)*pi^(3/2)*sqrt(2)
n(1/432*(27*sqrt(2) - 32)*pi^(3/2)*sqrt(2)) 
       
0.112722112725355
0.112722112725355
n((1/9)*pi^(3/4)*2^(3/4)*sqrt(3)/sqrt(0.112722112725355) ) 
       
2.27482744465886
2.27482744465886
n(1/sqrt(0.112722112725355 )) 
       
2.97848515558980
2.97848515558980
u2n(p)=2.97848515558980*exp(-2*p^2) -2.27482744465886*exp(-p^2) integral(u2n(p)^2*4*pi*p^2,p,0,oo) 
       
1/36*((6.65353036655*sqrt(2) + 15.5245197089)*sqrt(3) -
27.1021591018*sqrt(2))*pi^(3/2)*sqrt(2)*sqrt(3)
1/36*((6.65353036655*sqrt(2) + 15.5245197089)*sqrt(3) - 27.1021591018*sqrt(2))*pi^(3/2)*sqrt(2)*sqrt(3)
n((1/36)*((6.65353036655*sqrt(2) + 15.5245197089)*sqrt(3) - 27.1021591018*sqrt(2))*pi^(3/2)*sqrt(2)*sqrt(3)) 
       
n(1.621282/2.978485) 
       
0.544331094499385
0.544331094499385
g1(p)=(2/pi)^3/4 *exp(-p^2 ) g2(p)=2.978485*exp(-2*p^2) -1.621282*exp(-p^2 ) dv(p)=4*pi*p^2 integral(g2(p)^2*dv(p),p,0,10) 
       
var('Z'); phi(p)= (1/(8*pi^3)^(1/2))*8*sqrt(pi)*Z^(5/2)/(Z^4 + 2*Z^2*p^2 + p^4);phi(p) 
       
2*sqrt(2)*Z^(5/2)/((Z^4 + 2*Z^2*p^2 + p^4)*pi)
2*sqrt(2)*Z^(5/2)/((Z^4 + 2*Z^2*p^2 + p^4)*pi)
Z=1; phi(p)= (2^(3/2)/pi)*Z^(5/2)/(p^2+Z^2)^2 integral(phi(p)^2*4*pi*p^2,p,0,oo) 
       
1
1
x = var('x') g1 = plot(cos(20*x)*exp(-2*x), 0, 1) g2 = plot(2*exp(-30*x) - exp(-3*x), 0, 1) show(graphics_array([g1, g2],1,1), xmin=0) 
       
x=var('x') g1=(2/pi)^(3/4)*exp(-x^2 ) g2=2.978485*exp(-2*x^2 ) -1.621282*exp(-x^2) phi1= plot((2^(3/2) /pi) /(x^2 + 1 )^2,0,3) phi2= plot( g1 + 8.26E-2 * g2,0,3)  show(graphics_array([phi1, phi2],1,2), xmin=0) 
       
Traceback (click to the left of this block for traceback)
...
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_12.py", line 9, in <module>
    open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" + _support_.preparse_worksheet_cell(base64.b64decode("eD12YXIoJ3gnKQpnMT0oMi9waSleKDMvNCkqZXhwKC14XjIgKQpnMj0yLjk3ODQ4NSpleHAoLTIqeF4yICkgLTEuNjIxMjgyKmV4cCgteF4yKQpwaGkxPSBwbG90KCgyXigzLzIpIC9waSkgLyh4XjIgKyAxICleMiwwLDMpIApwaGkyPSBwbG90KCBnMSArIDguMjZFLTIgKiBnMiwwLDMpwqAKc2hvdyhncmFwaGljc19hcnJheShbcGhpMSwgcGhpMl0sMSwyKSwgeG1pbj0wKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpO8ZaEr/___code___.py", line 7
    phi2= plot( g1 + _sage_const_8p26En2  * g2,_sage_const_0 ,_sage_const_3 ) 
                                                                             ^
SyntaxError: invalid syntax
var('p') g1n(p)=(2/pi)^(3/4)*exp(-p^2 ) u2(p)= p*exp(-p^2) dv(p)=4*pi*p^2 g2(p)= 2.11661285743602 *(u2(p)-1.11951513492025*g1n(p)) norm=integral(g2(p)^2*dv(p),p,0,oo);n(norm) 
       
0.999999999999996
0.999999999999996
var('p') g1n(p)=(2/pi)^(3/4)*exp(-p^2 ) g2n(p)= 2.116613*(p*exp(-p^2 )-1.119515*(2/pi)^(3/4)*exp(-p^2 ) ) dv(p)=4*pi*p^2 norm=integral(g2n(p)*g1n(p)*dv(p),p,0,oo); n(norm) 
       
2.85573950264961e-7
2.85573950264961e-7
A=matrix([[ -0.423944443 , 0.0170494914 ],[ 0.0170494914 , 0.0841127038 ]]) A.eigenvalues() 
       
[0.0846842114303050, -0.424515950630305]
[0.0846842114303050, -0.424515950630305]