Dkunb

50 Reputation

3 Badges

3 years, 174 days

MaplePrimes Activity


These are replies submitted by Dkunb

@Mariusz Iwaniuk 

Thank you!

However, I would prefer to obtain the result through Maple.

@Rouben Rostamian  Thank you so much for your detailed and kind explanation in spite of my poor description on the problem due to my poor English. The next step I want to do is to find the density matrices if ths solution Z(t) is obtained.

Any further advice would be very appreciated . Thank you very much again!

@Rouben Rostamian   Could  you help me one more time?

 

restart;

with(IntegrationTools):with(Physics):

 

 

m1:=1:m2:=1:l:=1:

h1 := (m,n)->(n+1/2)*KroneckerDelta[n,m];

proc (m, n) options operator, arrow; Physics:-`*`(n+Physics:-`*`(1, Physics:-`^`(2, -1)), Physics:-KroneckerDelta[n, m]) end proc

(1)

h2 := (mu,nu)->-(nu*Pi/l)^2/(2*m2)*KroneckerDelta[mu,nu];

proc (mu, nu) options operator, arrow; Physics:-`*`(-1, Physics:-`*`(Physics:-`^`(Physics:-`*`(nu, Pi, Physics:-`^`(l, -1)), 2), Physics:-`^`(Physics:-`*`(2, m2), -1), Physics:-KroneckerDelta[mu, nu])) end proc

(2)

v1 := (m,n)->sqrt(min(n,m)!/max(n,m)!)*(2*m1)^(-abs(n-m)/2)*exp(-1/(4*m1))*LaguerreL(min(n,m),abs(n-m),-1/(2*m1));

proc (m, n) options operator, arrow; Physics:-`*`(sqrt(Physics:-`*`(factorial(min(n, m)), Physics:-`^`(factorial(max(n, m)), -1))), Physics:-`^`(Physics:-`*`(2, m1), Physics:-`*`(-1, Physics:-`*`(abs(n-m), Physics:-`^`(2, -1)))), exp(Physics:-`*`(-1, Physics:-`*`(1, Physics:-`^`(Physics:-`*`(4, m1), -1)))), LaguerreL(min(n, m), abs(n-m), Physics:-`*`(-1, Physics:-`*`(1, Physics:-`^`(Physics:-`*`(2, m1), -1))))) end proc

(3)

v2 := (mu,nu)->4*Pi^2*l*mu*nu*(exp(l/2)-(-1)^(mu+nu)*exp(-l/2))/((Pi*(mu+nu))^2+l^2)/((Pi*(mu-nu))^2+l^2);

proc (mu, nu) options operator, arrow; Physics:-`*`(4, Physics:-`^`(Pi, 2), l, mu, nu, exp(Physics:-`*`(l, Physics:-`^`(2, -1)))-Physics:-`*`(Physics:-`^`(-1, mu+nu), exp(Physics:-`*`(-1, Physics:-`*`(l, Physics:-`^`(2, -1))))), Physics:-`^`(Physics:-`^`(Physics:-`*`(Pi, mu+nu), 2)+Physics:-`^`(l, 2), -1), Physics:-`^`(Physics:-`^`(Physics:-`*`(Pi, mu-nu), 2)+Physics:-`^`(l, 2), -1)) end proc

(4)

h:=(m,n,mu,nu)->h1(m,n)+h2(mu,nu)+v1(m,n)+v2(mu,nu);

proc (m, n, mu, nu) options operator, arrow; h1(m, n)+h2(mu, nu)+v1(m, n)+v2(mu, nu) end proc

(5)

N:=2:M:=2:

Z:= Array(0..N-1,1..M, (i,j)->z[i,j](t));

`Array(0..1, 1..2, {(0, 2) = z[0, 1](t), (1, 1) = z[0, 1](t), (1, 2) = z[1, 1](t)})`

(6)

add(add(evalf(h(m,n,mu,nu))*z[n,mu](t),n=0..N-1), mu=1..M):
mnu_entry := unapply(%,m,nu):

the_rhs := Array(0..N-1,1..M,mnu_entry):

DE := I*diff(Z,t)= the_rhs;

`Array(0..1, 1..2, {(0, 2) = \`*\`(I, \`*\`(diff(z[0, 1](t), t))), (1, 1) = \`*\`(I, \`*\`(diff(z[0, 1](t), t))), (1, 2) = \`*\`(I, \`*\`(diff(z[1, 1](t), t)))})` = `Array(0..1, 1..2, {(0, 2) = \`+\`(\`-\`(\`*\`(2.639557630, \`*\`(z[0, 1](t)))), \`-\`(\`*\`(3.367663098, \`*\`(z[1, 1](t)))), \`*\`(1.461176441, \`*\`(z[0, 2](t))), \`*\`(.7330709726, \`*\`(z[1, 2](t)))), (1, 1) = \`+\`(\`-\`(\`*\`(2.639557630, \`*\`(z[0, 1](t)))), \`-\`(\`*\`(3.367663098, \`*\`(z[1, 1](t)))), \`*\`(1.461176441, \`*\`(z[0, 2](t))), \`*\`(.7330709726, \`*\`(z[1, 2](t)))), (1, 2) = \`+\`(\`-\`(\`*\`(3.367663098, \`*\`(z[0, 1](t)))), \`-\`(\`*\`(1.250157238, \`*\`(z[1, 1](t)))), \`*\`(.7330709726, \`*\`(z[0, 2](t))), \`*\`(2.850576833, \`*\`(z[1, 2](t))))})`

(7)

IC := eval(Z,t=0) = Array(0..N-1,1..M, (i,j)->`if`(i=j-1,1,0));

`Array(0..1, 1..2, {(0, 2) = z[0, 1](0), (1, 1) = z[0, 1](0), (1, 2) = z[1, 1](0)})` = `Array(0..1, 1..2, {(0, 2) = 1, (1, 1) = 1, (1, 2) = 0})`

(8)

dsol := dsolve({DE,IC});

`[Length of output exceeds limit of 1000000]`

(9)

Download collision_zmatrix_v3.mw

@Rouben Rostamian  Thank you a lot!! 

@Rouben Rostamian  

dz:= diff(Z(t),t)= -I* (Multiply(hm1,Z(t))+Multiply(Z(t),hm2)+Multiply(Multiply(vm1,Z(t)),Transpose(vm2))); 

restart;

with(IntegrationTools):with(Physics):with(LinearAlgebra):

 

 

m1:=1:m2:=1:l:=1:

h1 := (m,n)->(n+1/2)*KroneckerDelta[n,m];

proc (m, n) options operator, arrow; Physics:-`*`(n+Physics:-`*`(1, Physics:-`^`(2, -1)), Physics:-KroneckerDelta[n, m]) end proc

(1)

h2 := (mu,nu)->-(nu*Pi/l)^2/(2*m2)*KroneckerDelta[mu,nu];

proc (mu, nu) options operator, arrow; Physics:-`*`(-1, Physics:-`*`(Physics:-`^`(Physics:-`*`(nu, Pi, Physics:-`^`(l, -1)), 2), Physics:-`^`(Physics:-`*`(2, m2), -1), Physics:-KroneckerDelta[mu, nu])) end proc

(2)

v1 := (m,n)->sqrt(min(n,m)!/max(n,m)!)*(2*m1)^(-abs(n-m)/2)*exp(-1/(4*m1))*LaguerreL(min(n,m),abs(n-m),-1/(2*m1));

proc (m, n) options operator, arrow; Physics:-`*`(sqrt(Physics:-`*`(factorial(min(n, m)), Physics:-`^`(factorial(max(n, m)), -1))), Physics:-`^`(Physics:-`*`(2, m1), Physics:-`*`(-1, Physics:-`*`(abs(n-m), Physics:-`^`(2, -1)))), exp(Physics:-`*`(-1, Physics:-`*`(1, Physics:-`^`(Physics:-`*`(4, m1), -1)))), LaguerreL(min(n, m), abs(n-m), Physics:-`*`(-1, Physics:-`*`(1, Physics:-`^`(Physics:-`*`(2, m1), -1))))) end proc

(3)

v2 := (mu,nu)->4*Pi^2*l*mu*nu*(exp(l/2)-(-1)^(mu+nu)*exp(-l/2))/((Pi*(mu+nu))^2+l^2)/((Pi*(mu-nu))^2+l^2);

proc (mu, nu) options operator, arrow; Physics:-`*`(4, Physics:-`^`(Pi, 2), l, mu, nu, exp(Physics:-`*`(l, Physics:-`^`(2, -1)))-Physics:-`*`(Physics:-`^`(-1, mu+nu), exp(Physics:-`*`(-1, Physics:-`*`(l, Physics:-`^`(2, -1))))), Physics:-`^`(Physics:-`^`(Physics:-`*`(Pi, mu+nu), 2)+Physics:-`^`(l, 2), -1), Physics:-`^`(Physics:-`^`(Physics:-`*`(Pi, mu-nu), 2)+Physics:-`^`(l, 2), -1)) end proc

(4)

#h:=(m,n,mu,nu,m1,m2,l)->evalf(h1(m,n)+h2(mu,nu,m2,l)+v1(m,n,m1)+v2(mu,nu,l));

 

#H:= (m,n,mu,nu)->h(m,n,mu,nu,m1,m2,l);

#H(1,1,0,0);

#N:=5:M:=5:

#eq1:= (m,nu)->diff(z(m,nu,t),t)=-I*Sum(Sum(H(m,n,mu,nu)*z(n,mu,t),n=1..N),mu=0..M);

hm1:= Matrix(5,h1);

Matrix(5, 5, {(1, 1) = 3/2, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 5/2, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 7/2, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 9/2, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 11/2})

(5)

hm2:=evalf(Matrix(5,h2));

Matrix(5, 5, {(1, 1) = -4.934802202, (1, 2) = 0., (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (2, 1) = 0., (2, 2) = -19.73920881, (2, 3) = 0., (2, 4) = 0., (2, 5) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = -44.41321982, (3, 4) = 0., (3, 5) = 0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = -78.95683523, (4, 5) = 0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = -123.3700550})

(6)

vm1:=evalf(Matrix(5,v1));

Matrix(5, 5, {(1, 1) = 1.168201175, (1, 2) = .9735009790, (1, 3) = .5564021546, (1, 4) = .2529229733, (1, 5) = 0.9775488176e-1, (2, 1) = .9735009790, (2, 2) = 1.654951664, (2, 3) = 1.470491409, (2, 4) = .9133329600, (2, 5) = .4487837751, (3, 1) = .5564021546, (3, 2) = 1.470491409, (3, 3) = 2.255277267, (3, 4) = 2.070843841, (3, 5) = 1.362322990, (4, 1) = .2529229733, (4, 2) = .9133329600, (4, 3) = 2.070843841, (4, 4) = 2.987431129, (4, 5) = 2.796927709, (5, 1) = 0.9775488176e-1, (5, 2) = .4487837751, (5, 3) = 1.362322990, (5, 4) = 2.796927709, (5, 5) = 3.871897331})

(7)

vm2:=evalf(Matrix(5,v2));

Matrix(5, 5, {(1, 1) = 1.016443788, (1, 2) = .1823756578, (1, 3) = 0.1918860319e-1, (1, 4) = 0.1600347438e-1, (1, 5) = 0.3633229210e-2, (2, 1) = .1823756578, (2, 2) = 1.035632392, (2, 3) = .1983791322, (2, 4) = 0.2282183242e-1, (2, 5) = 0.2045303165e-1, (3, 1) = 0.1918860319e-1, (3, 2) = .1983791322, (3, 3) = 1.039265621, (3, 4) = .2028286895, (3, 5) = 0.2409949261e-1, (4, 1) = 0.1600347438e-1, (4, 2) = 0.2282183242e-1, (4, 3) = .2028286895, (4, 4) = 1.040543281, (4, 5) = .2046649072, (5, 1) = 0.3633229210e-2, (5, 2) = 0.2045303165e-1, (5, 3) = 0.2409949261e-1, (5, 4) = .2046649072, (5, 5) = 1.041135720})

(8)

 

dz:= diff(Z(t),t)=Multiply(hm1,Z(t))+Multiply(Z(t),hm2)+Multiply(Multiply(vm1,Z(t)),Transpose(vm2));

diff(Z(t), t) = (Matrix(5, 5, {(1, 1) = -2.054769102*Z(t), (1, 2) = 1.339390731*Z(t), (1, 3) = .8474439372*Z(t), (1, 4) = .4369509680*Z(t), (1, 5) = .1911049546*Z(t), (2, 1) = 1.335795632*Z(t), (2, 2) = -15.02600665*Z(t), (2, 3) = 2.071284755*Z(t), (2, 4) = 1.393819037*Z(t), (2, 5) = .7269958521*Z(t), (3, 1) = .9150993004*Z(t), (3, 2) = 2.146886777*Z(t), (3, 3) = -37.81413847*Z(t), (3, 4) = 2.933520963*Z(t), (3, 5) = 1.928640771*Z(t), (4, 1) = .5213594422*Z(t), (4, 2) = 1.528200699*Z(t), (4, 3) = 3.011537528*Z(t), (4, 4) = -70.33093277*Z(t), (4, 5) = 3.592909300*Z(t), (5, 1) = .2661787052*Z(t), (5, 2) = .8958826320*Z(t), (5, 3) = 2.167328507*Z(t), (5, 4) = 3.990890516*Z(t), (5, 5) = -113.2240860*Z(t)}))

(9)

zint:= (m,n)->KroneckerDelta[m,n];

proc (m, n) options operator, arrow; Physics:-KroneckerDelta[m, n] end proc

(10)

Z0:=Matrix(5,zint);

Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 1})

(11)

sol:=dsolve({dz,Z(0)=Z0},Z(t));

Error, (in dsolve) invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received {Z(0) = (Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 1}))}

 

 

Download test4.mw

@Rouben Rostamian  Thank you so much!

@C_R Thank you!

@C_R  How to know the assumption 1/5<x<1 does not fit to the 3rd and 4th root which seem to be complex other than plotting??

Thanks  a lot !

@mmcdara Thank you!

@dharr 

Stupid me! Thanks!!

@mmcdara I tried to run the code based on your code with different parameter, it gave me overflow. What should I do to fix this issue?

And how can I try to find the correct method and options for numerical integration? ( for example? )

Thanks in advance

Negativity_(v13_beta_gamma_mu).mw

1 2 3 Page 1 of 3