Solved Problems in Mathematical Physics

4224 days ago by comphy

# Mathematical methods / Numerical codes #Lectures on Quantum Mechanics #http://www.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 #http://www1.uprh.edu/rbaretti/methodsoftheoreticalphysicspart6.htm #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 c1,c2,c3=var('c1,c2,c3') solve([.175*c1+.248*c2+.524*c3==.903,.248*c1+.276*c2+.466*c3==.996,.524*c1+.466*c2 +.636*c3==1.99],c1,c2,c3) # bi= 0.903E+00 0.996E+00 0.199E+01 #kij= 0.175E+00 0.248E+00 0.524E+00 # 0.248E+00 0.276E+00 0.466E+00 # 0.524E+00 0.466E+00 0.636E+00 #i1,i2=var('i1,i2') #solve([200*i1-100*i2==1.5,-100*i1+200*i2==5],i1,i2) 
       
# www.geocities.com/serienumerica4 # bi= 0.903E+00 0.996E+00 0.199E+01 #c kij= 0.175E+00 0.248E+00 0.524E+00 #c 0.248E+00 0.276E+00 0.466E+00 R=RealField(20) var('c1,c2'); solve([.175*c1+.248*c2==.903,.248*c1+.276*c2==.996],c1,c2) 
       
[[c1 == (-555/3301), c2 == (12411/3301)]]
[[c1 == (-555/3301), c2 == (12411/3301)]]
n(-555/3301) , n (12411/3301) 
       
(-0.168130869433505, 3.75976976673735)
(-0.168130869433505, 3.75976976673735)
# bi= 0.903E+00 0.996E+00 0.199E+01 #c kij= 0.175E+00 0.248E+00 0.524E+00 #c 0.248E+00 0.276E+00 0.466E+00 c1,c2=var('c1,c2') solve([.175*c1+.248*c2==.903,.248*c1+.276*c2==.996],c1,c2) #R(c1),R(c2) 
       
# bi= 0.927E+00 -0.135E+00 0.840E+01 # kij= # 0.120E+01 -0.937E-01 0.775E+01 # -0.937E-01 -0.518E+00 0.571E+01 # 0.775E+01 0.571E+01 0.962E+01 c1,c2,c3=var('c1,c2,c3') solve([1.20*c1-0.937E-01*c2+0.775E+01*c3==.927, -0.937E-01*c1 -0.518E+00*c2+0.571E+01*c3== -0.135E,0.775E+01*c1+0.571E+01*c2+9.62*c3==8.40],c1,c2,c3) #R(c1),R(c2),R(c3) 
       
Syntax Error:
    -0.135E,0.775E+01*c1+0.571E+01*c2+9.62*c3==8.40],c1,c2,c3)
Syntax Error:
    -0.135E,0.775E+01*c1+0.571E+01*c2+9.62*c3==8.40],c1,c2,c3)
continuation? 
       
#deltat= 1. #b(i)= 0.100E+01 0.500E+00 0.333E+00 #b(i)= 0.667E+00 0.500E+00 0.400E+00 0.333E+00 # 0.333E+00 0.478E+00 0.342E+00 0.123E+00 # 0.333E+00 0.342E+00 0.176E+00 0.451E-01 # 0.333E+00 0.245E+00 0.902E-01 0.166E-01 # 0.333E+00 0.176E+00 0.463E-01 0.611E-02 f1,f2,f3,f4=var('f1,f2,f3,f4'); solve([.333*f1+.478*f2+.342*f3+.123*f3==.667,.33*f1+.34*f2+.17*f3+.045*f4==.5,.33*f1+.24*f2+.091*f3+.0166*f4==.4,.33*f1+.176*f2+.0463*f3+.00611*f4==.333],f1,f2,f3,f4) 
       
[[f1 == 133596523/317946768, f2 == 237949891/211964512, f3 ==
-1085025/52991128, f4 == -9928125/26495564]]
[[f1 == 133596523/317946768, f2 == 237949891/211964512, f3 == -1085025/52991128, f4 == -9928125/26495564]]
R=RealField(20) R(133596523/317946768) ; R(-1085025/52991128 );R(-9928125/26495564); 
       
0.42019
-0.020476
-0.37471
0.42019
-0.020476
-0.37471
i1,i2=var('i1,i2') solve([.333*i1+.478*i2==1.667,.33*i1+.34*i2==.5],i1,i2) 
       
[[i1 == -5463/742, i2 == 12787/1484]]
[[i1 == -5463/742, i2 == 12787/1484]]
#sage: A=matrix([[1,1],[2,3]]) #sage: A.eigenvalues() #[0.2679491924311228?, 3.732050807568878?] A=matrix([[1,1,1],[1,3,5],[1,5,4]]) A.eigenvalues() 
       
[-1.527069054684481?, 0.7457280539128812?, 8.781341000771600?]
[-1.527069054684481?, 0.7457280539128812?, 8.781341000771600?]
 
       
 
       
C,D,k2,k,a=var('C,D,k2,k,a') solve([e^(-k2*a)*C+e^(k2*a)*D==e^(I*k*a),-k2*e^(-k2*a)*C+k2*e^(k2*a)*D==I*k*e^(I*k*a)],C,D) 
       
[[C == 1/2*(-I*k + k2)*e^(I*a*k + a*k2)/k2, D == 1/2*(I*k + k2)*e^(I*a*k
- a*k2)/k2]]
[[C == 1/2*(-I*k + k2)*e^(I*a*k + a*k2)/k2, D == 1/2*(I*k + k2)*e^(I*a*k - a*k2)/k2]]
#sage: k.<I> = QuadraticField(-1) #sage: I.conjugate() #-I #sage: (I/(1+I)).conjugate() #-1/2*I + 1/2 #sage: z6=CyclotomicField(6).gen(0) #sage: (2*z6).conjugate() #-2*zeta6 + 2 #sage: K.<j,b> = QQ[sqrt(-1), sqrt(2)] #sage: j.conjugate() #(3+2*I).conjugate() #f=1+3*I ; #(1+3*I)*( 1+I*3 ).conjugate() f=1+3*I;f*f.conjugate() A=(1/4*k2*k) 
       
10
10
#sage: A=matrix([[1,1],[2,3]]) #sage: A.eigenvalues() A=matrix([[1,2],[2,3]] ); A.eigenvalues() 
       
[-0.2360679774997897?, 4.236067977499789?]
[-0.2360679774997897?, 4.236067977499789?]
A=matrix([[1,2],[2,4]]); A.eigenvalues() #[[0,4],[3,1]] #A=matrix([[6,-1,1],[-1,3,-2],[1,-2,3]] ); #A.eigenvalues() #A.eigenvectors() 
       
# 0.984E+01 -0.797E-07 0.570E+01 #-0.797E-07 0.303E+02 0.312E-06 # 0.570E+01 0.312E-06 0.561E+02 # A= matrix([[9.84,0 ],[0,30.3]]); A=matrix([[9.84,0,5.70],[0,30.3,0],[5.70,0,56.1]] ); A.eigenvalues() 
       
[56.7919835446169, 30.3000000000000, 9.14801645538306]
[56.7919835446169, 30.3000000000000, 9.14801645538306]
# http://www.sagemath.org/doc/tutorial/interfaces.html#section-maxima sage: A.echelon() matrix([1,1/2,1/3,1/4],[0,0,0,0],[0,0,0,0],[0,0,0,0]) sage: A.eigenvalues() #[[0,4],[3,1]] #sage: A.eigenvectors() #[[[0,4],[3,1]],[1,0,0,-4],[0,1,0,-2],[0,0,1,-4/3],[1,2,3,4]] 
       
Syntax Error:
    sage: A.echelon()
Syntax Error:
    sage: A.echelon()
A=matrix([[3,2],[2,4]]); A.eigenvalues() A.eigenvectors() 
       
Traceback (click to the left of this block for traceback)
...
AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_de'
object has no attribute 'eigenvectors'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sage/sagenb/sage_notebook/worksheets/reibaretti/32/code/9.py", line 9, in <module>
    A.eigenvectors()
  File "", line 1, in <module>
    
AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_de' object has no attribute 'eigenvectors'
sage: MS = MatrixSpace(QQ, 3, 3) sage: A = MS([[1,1,0],[1,2,0],[0,0, 3]]) sage: A [1 1 0] [1 2 0] [0 0 3] #sage: A.eigenspaces() A.eigenvalues() 
       
[1 1 0]
[1 2 0]
[0 0 3]
[1 1 0]
[1 2 0]
[0 0 3]
A=matrix(QQ,[[1,1,0],[1,2,0],[0,0,3]]); #A.eigenspaces() A.eigenvalues() 
       
[3, 0.3819660112501051?, 2.618033988749895?]
[3, 0.3819660112501051?, 2.618033988749895?]
K=matrix(QQ,[[1,2],[2,3]]); K.eigenvalues() 
       
[-0.2360679774997897?, 4.236067977499789?]
[-0.2360679774997897?, 4.236067977499789?]
#i,j, kij= 1 1 0.83338E-01 #i,j, kij= 1 2 -0.17320E+00 #i,j, kij= 1 3 -0.37957E-03 #i,j, kij= 1 4 0.18915E-01 #i,j, kij= 2 2 -0.82829E-01 #i,j, kij= 2 3 -0.27667E-01 #i,j, kij= 2 4 -0.31605E-03 #i,j, kij= 3 3 0.59531E-03 #i,j, kij= 3 4 -0.28169E-01 #i,j, kij= 4 4 0.61117E-03 K=matrix(QQ,[[8.33E-2,-1.73E-1],[-1.73E-1,-8.28E-2]]); K.eigenvalues() 
       
[-0.1916518043166870?, 0.1921518043166870?]
[-0.1916518043166870?, 0.1921518043166870?]
var('x ,f');f=(x-8.33E-2)*(x+8.28E-2) -(1.73e-1)^2 ; y=plot(f,x,-.3,1); show(y) 
       

                                
                            

                                
#i,j, kij= 1 1 0.10119E+00 #i,j, kij= 1 2 -0.15749E+00 #i,j, kij= 1 3 0.71977E-01 #i,j, kij= 2 2 -0.57507E-01 #i,j, kij= 2 3 0.82789E-02 #i,j, kij= 3 3 0.25756E-01 K=matrix(QQ,[[0.10119E+00,-0.15749E+00,0.71977E-01],[-0.15749E+00,-0.57507E-01,0.82789E-02],[ 0.71977E-01,0.82789E-02 ,0.25756E-01 ]]); K.eigenvalues() 
       
[-0.1655127048306282?, 0.01919336910404436?, 0.2157583357265839?]
[-0.1655127048306282?, 0.01919336910404436?, 0.2157583357265839?]
a=1/(0.2157583357); n(a) 
       
4.63481513590485
4.63481513590485
a=1/.01919336910404436; n(a) 
       
52.1013270040893
52.1013270040893
K=matrix(QQ,[[0.10119E+00,0.60232E-09 ],[ 0.60232E-09,0.25002E-01 ]]); K.eigenvalues() 
       
[0.02500200000000000?, 0.10119000000000001?]
[0.02500200000000000?, 0.10119000000000001?]
n(1/pi^2); n(1/(4*pi^2)) 
       
0.101321183642338
0.0253302959105844
0.101321183642338
0.0253302959105844
#i,j, kij= 1 1 0.10119E+00 #i,j, kij= 1 2 0.60232E-09 #i,j, kij= 1 3 -0.34367E-02 #i,j, kij= 2 2 0.25002E-01 #i,j, kij= 2 3 -0.34627E-08 #i,j, kij= 3 3 0.10933E-01 K=matrix(QQ,[[0.10119E+00,0.60232E-09,-0.34367E-02 ],[ 0.60232E-09,0.25002E-01,-0.34627E-08 ],[ -0.34367E-02, -0.34627E-08 , 0.10933E-01 ]]); K.eigenvalues() 
       
[0.01080233055180890?, 0.02500200000000083?, 0.1013206694481903?]
[0.01080233055180890?, 0.02500200000000083?, 0.1013206694481903?]
n(1/pi^2) , n(1/(4*pi^2)) ,n(1/(9*pi^2)) 
       
(0.101321183642338, 0.0253302959105844, 0.0112579092935931)
(0.101321183642338, 0.0253302959105844, 0.0112579092935931)
var('x'); phi1=(30)^(1/2)*x*(1-x); phi2=2*(210)^(1/2)*( x^2*(1-x) -(1-x)*x/2 ); #phi3=(17640)^(1/2)*( x^3*(1-x) - ((30)^(1/2)/105)*phi1 - ( 1/(2*(210)^(1/2)))*phi2 ); phi3=(17640)^(1/2)*( x^3*(1-x) );   y=plot(phi3,x,0,1); show(y) 
       
Syntax Error:
    y=plot(phi3,x,0,1);
Syntax Error:
    y=plot(phi3,x,0,1);
phin=x^2-3*x^2+5;phin 
       
-2*x^2 + 5
-2*x^2 + 5
var('x');phi1=1; phi3a=(17640)^(1/2)*( x^3*(1-x)) -( (30)^(1/2)/105 )*(30)^(1/2)  x*(1-x) ); phi3=phi3a - (17640)^(1/2)*x^3; plot(phi3,x,0,1); show(y) 
       
Syntax Error:
    phi3=phi3a - (17640)^(1/2)*x^3;
Syntax Error:
    phi3=phi3a - (17640)^(1/2)*x^3;
a3=1/0.01080233055180890 ;n(a3) , n(9*pi^2) 
       
(92.5726161779548, 88.8264396098042)
(92.5726161779548, 88.8264396098042)
#solve([.333*i1+.478*i2==1.667,.33*i1+.34*i2==.5],i1,i2) c2,c3=var('c2,c3') c1=1;lambda= 9.8696544;mu=1/lambda; k11=0.10119; k12= 0.60232e-09; k13=-0.34367e-02; k21=k12; k22= 0.25002e-01;k23=-0.34627e-08 ; b1=-(k11-mu) ;b2=-k21; solve([k12*c2+k13*c3==b1,(k22-mu)*c2+ k23*c3==b2],c2,c3) 
       
Syntax Error:
    c1=1;lambda= 9.8696544;mu=1/lambda; k11=0.10119; k12= 0.60232e-09;
k13=-0.34367e-02; k21=k12; k22= 0.25002e-01;k23=-0.34627e-08 ;
b1=-(k11-mu) ;b2=-k21;
Syntax Error:
    c1=1;lambda= 9.8696544;mu=1/lambda; k11=0.10119; k12= 0.60232e-09; k13=-0.34367e-02; k21=k12; k22= 0.25002e-01;k23=-0.34627e-08 ; b1=-(k11-mu) ;b2=-k21;
c1,c2=var('c1,c2') a11=1.75e-1;a12=0.248; solve([a11*c1+a12*c2==.903,.248*c1+.276*c2==.996],c1,c2) 
       
[[c1 == (-555/3301), c2 == (12411/3301)]]
[[c1 == (-555/3301), c2 == (12411/3301)]]
a11=3 ; a22=5; phi1(x)=a11*x ; phi2(x)=a22*x^2; integral(phi1(x)*phi2(x),x,0,2) 
       
60
60
var('x ,f');f=(1/8)*(1-x^2)*x ; y=plot(f,x,-1,1); show(y) 
       

                                
                            

                                
var('a,b'); #(27/32)a + (243/128)b + 729/128 # 3456/625*a + 108864/3125*b + 746496/3125 solve([(27/32)*a+ (243/128)*b==-729/128, (3456/625)*a+(108864/3125)*b==-746496/3125],a,b) 
       
[[a == (27/2), b == -9]]
[[a == (27/2), b == -9]]
c0,c1,c2=var('c0,c1,c2'); #b0,b1,b2= 0.159E+01 -0.120E+00 0.576E-02 b0=0.159E+01;b1=-0.120E+00;b2=0.576E-02; #k00,k01,k02,k11,k12,,k22= 0.132E+01 0.122E+00 0.896E-02 0.469E-01 0.47 #3E-02 0.120E-02 k00=0.132E+01;k01=0.122E+00;k10=k01;k02=0.896E-02;k20=k02;k11=0.469E-01;k12=0.473E-02;k21=k12;k22=0.120E-02; solve([k00*c0+ k01*c1+k02*c2==b0,k10*c0+ k11*c1+k12*c2 ==b1,k20*c0+ k21*c1+k22*c2 ==b2 ],c0,c1,c2); 
       
[[c0 == (186938801/92978556), c1 == (-260766320/23244639), c2 ==
(790475750/23244639)]]
[[c0 == (186938801/92978556), c1 == (-260766320/23244639), c2 == (790475750/23244639)]]
n(790475750/23244639 ) 
       
34.0067982987389
34.0067982987389
c0,c1=var('c0,c1'); #b0,b1,b2=0.796E+00 0.368E+00 b0=.417 ;b1=.278 ; k00=.250 ;k01=.167;k10=k01;k11=.111; solve([k00*c0+ k01*c1==b0,k10*c0+ k11*c1==b1 ],c0,c1); 
       
[[c0 == 1, c1 == 1]]
[[c0 == 1, c1 == 1]]
n( 13544/3119 ) , n (-21442/3119) 
       
(4.34241744148766, -6.87463930747034)
(4.34241744148766, -6.87463930747034)
x,y=var('x,y') integral(exp(y)*exp(y*x),y,0,1) 
       
e^(x + 1)/(x + 1) - 1/(x + 1)
e^(x + 1)/(x + 1) - 1/(x + 1)
b0,b1,b2= 0.237E+01 0.130E+01 0.187E+00 k00,k01,k02= 0.132E+01 0.718E+00 0.911E-01 k10,k11,k12= 0.718E+00 0.400E+00 0.634E-01 k20,k21,k22= 0.911E-01 0.634E-01 0.278E-01 
       
Syntax Error:
    k10,k11,k12=   0.718E+00   0.400E+00   0.634E-01
Syntax Error:
    k10,k11,k12=   0.718E+00   0.400E+00   0.634E-01
c0,c1,c2,c3=var('c0,c1,c2,c3'); b0,b1,b2,b3=var(' b0,b1,b2,b3 '); k00,k01,k02,k03= (' k00,k01,k02,k03 ' ); k10,k11,k12,k13= (' k10,k11,k12,k13 ' ); k20,k21,k22,k23= (' k20,k21,k22,k23 ' ); k30,k31,k32,k33= ('k30,k31,k32,k33 ' ); b0=0.237E+01; b1=0.130E+01; b2= 0.913E+00;b3=.706 ; k00= 0.132E+01; k01= 0.718E+00;k02=.500;k03=.385; k10=0.718E+00;k11=0.400E+00; k12= 0.282;k13=.218 ; k20=0.500; k21=.282; k22=0.199;k23=.155 ; k30=.385; k31=.218 ; k32=.155;k33=.121 ; solve([k00*c0+ k01*c1+k02*c2+k03*c3==b0,k10*c0+ k11*c1+k12*c2+k13*c3==b1,k20*c0+ k21*c1+k22*c2+k23*c3==b2,k30*c0+ k31*c1+k32*c2+k33*c3==b3 ],c0,c1,c2,c3); 
       
Traceback (click to the left of this block for traceback)
...
ValueError: too many values to unpack
Traceback (most recent call last):    k20,k21,k22,k23= (' k20,k21,k22,k23 '  ); 
ValueError: too many values to unpack
 
       
(0.454769990737882, 4.97530101883297, -3.60512503859216)
(0.454769990737882, 4.97530101883297, -3.60512503859216)
a=1; f(x)=a*exp(-x); #integral(f(x),x,0,.75) y=plot(f(x),x,0,4) show(y) 
       

                                
                            

                                
#A=matrix([[9.84,0,5.70],[0,30.3,0],[5.70,0,56.1]] ); #A.eigenvalues() A=matrix([[-0.434047461,-0.0411980152],[-0.0411980152, 0.0384942591 ]]) A.eigenvalues() 
       
[0.0420591673690439, -0.437612369269044]
[0.0420591673690439, -0.437612369269044]
A=matrix([[ -0.427069992 ,-0.0412402749 ],[-0.0412402749 , 0.0452692211 ]]) A.eigenvalues() 
       
[0.0488429008622748, -0.430643671762275]
[0.0488429008622748, -0.430643671762275]
A=matrix([[ -0.42706 ,-0.0412402 ],[-0.0412402 , 0.045269 ]]);A es=A.eigenvectors_right();es 
       
[(0.0488427429990885, [

], 1), (-0.430633742999088, [

], 1)]
[(0.0488427429990885, [

], 1), (-0.430633742999088, [

], 1)]
A=matrix([[ 1 ,3 ],[3 , 1 ]]);A es=A.eigenvectors_right();es 
       
[(4, [
(1, 1)
], 1), (-2, [
(1, -1)
], 1)]
[(4, [
(1, 1)
], 1), (-2, [
(1, -1)
], 1)]
n( (-0.434047461+0.4306436717)/-0.0411980152) 
       
0.0826202253549345
0.0826202253549345
c1=1 c2=8.26E-2 g1(p)=(2/pi)^(3/4)*exp(-p^2 ) g2(p)= 2.978485*exp(-2*p^2 ) -1.621282*exp(-p^2 ) phi(p)=c1*g1(p)+c2*g2(p) norm=integral(phi(p)^2*4*pi*p^2,p,0,oo);n(norm) 
       
1.00682273129350
1.00682273129350