Dkunb

45 Reputation

3 Badges

1 years, 260 days

MaplePrimes Activity


These are questions asked by Dkunb

How to find Z(t) matrix(array) =[ [z[1,0](t),z[1,1](t)],[z[2,0](t),z[2,1](t)]]

restart;

with(IntegrationTools):with(Physics):

 

 

 

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,m2,l)->-(nu*Pi/l)^2/(2*m2)*KroneckerDelta[mu,nu];

proc (mu, nu, m2, l) 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,m1)->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, m1) 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,l)->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, l) 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));

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

(5)

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

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

proc (m, n, mu, nu) options operator, arrow; h(m, n, mu, nu, m1, m2, l) end proc

(6)

H(1,1,0,0);

2.668201175

(7)

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

diff(z(m, nu, t), t) = -I*(Sum(Sum(((n+.5000000000)*Physics:-KroneckerDelta[m, n]-4.934802202*nu^2*Physics:-KroneckerDelta[mu, nu]+.7788007831*(factorial(min(m, n))/factorial(max(m, n)))^(1/2)*2.^(-.5000000000*abs(-1.*n+m))*LaguerreL(min(m, n), abs(-1.*n+m), -.5000000000)+39.47841762*mu*nu*(1.648721271-.6065306597*(-1.)^(mu+nu))/((9.869604404*(mu+nu)^2+1.)*(9.869604404*(mu-1.*nu)^2+1.)))*z(n, mu, t), n = 1 .. N), mu = 0 .. M))

(8)

 

zint := Array([[1,0],[0,1]]);

Matrix(2, 2, {(1, 1) = 1, (1, 2) = 0, (2, 1) = 0, (2, 2) = 1})

(9)

Z:= Array(1..2,1..2);
 for i from 1to 2 do
    for j from 1 to 2 do
        Z[i,j]:= dsolve({eq1,zint[i,j]},numeric,output=listprocedure);
    end do;
end do;

 

Matrix(2, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = 0, (2, 2) = 0})

 

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

 

 

Download test3.mw

how to write the code for integration of the orthogonal cosine function with nu=mu or with nu<>mu

restart;

 

phi:= (mu,Q2)->sqrt(2/l)*sin(mu*Pi*(Q2+l/2)/l);    # E:=mu->(Pi*mu/sqrt(2)/l)^2, mu=1,2...

proc (mu, Q2) options operator, arrow; sqrt(2/l)*sin(mu*Pi*(Q2+(1/2)*l)/l) end proc

(1)

fh1:=simplify((-1/2/m2*Int(diff(phi(mu,Q2),Q2)*diff(phi(nu,Q2),Q2),Q2=-l/2..l/2)))

-mu*Pi^2*nu*(Int(cos((1/2)*mu*Pi*(2*Q2+l)/l)*cos((1/2)*nu*Pi*(2*Q2+l)/l), Q2 = -(1/2)*l .. (1/2)*l))/(l^3*m2)

(2)

convert(fh1,int) assuming(mu,integer,nu,integer);

0

(3)

fh1_subs := simplify(subs(nu = mu, fh1));

-mu^2*Pi^2*(Int(cos((1/2)*mu*Pi*(2*Q2+l)/l)^2, Q2 = -(1/2)*l .. (1/2)*l))/(l^3*m2)

(4)

convert(fh1_substituted,int)assuming (mu,integer,nu,integer);

-(1/2)*mu^2*Pi^2/(l^2*m2)

(5)

 

Download test1.mw

Could you help me how to deal with this problem?

restart;

with(plots):with(plottools):with(DETools):

 

Sys:=diff(T(R),R)=((1-1/R)*(sqrt(1-(alpha/R)^2*(1-1/R))))^(-1),diff(Phi(R),R)=(alpha/R)^2*(sqrt(1-(alpha/R)^2*(1-1/R)))^(-1);

diff(T(R), R) = 1/((1-1/R)*(1-alpha^2*(1-1/R)/R^2)^(1/2)), diff(Phi(R), R) = alpha^2/(R^2*(1-alpha^2*(1-1/R)/R^2)^(1/2))

(1)

 

inits:=[[T(0)=0.5,Phi(0)=0],[T(0)=0.5,Phi(0)=Pi/4]];

[[T(0) = .5, Phi(0) = 0], [T(0) = .5, Phi(0) = (1/4)*Pi]]

(2)

K:=dsolve([Sys,op(op(1,inits))],[Phi(R),T(R)],numeric,parameters=[alpha],output=listprocedure);

Error, (in dsolve/numeric/make_proc) ode system is singular at the initial point

 

 

Download HW6.m

Could you help me to solve this problem for the parameter beta?

restart;

e1:= 0.5; e2:=0.2;theta:=5;yeq:=e2;

.5

 

.2

 

5

 

.2

(1)

f:=(theta*x-1)*(1-x)*(1+beta*x^2)-y;
g:=x/(1+beta*x^2); gs:=unapply(g,x);

(5*x-1)*(1-x)*(beta*x^2+1)-y

 

x/(beta*x^2+1)

 

proc (x) options operator, arrow; x/(beta*x^2+1) end proc

(2)

fs:=subs(y=yeq,f);

(5*x-1)*(1-x)*(beta*x^2+1)-.2

(3)

assumptions:=x>1/theta, x<1,beta>0,beta<1,gs(x)>e1;
solve(fs=0,x,useassumptions) assuming assumptions;

1/5 < x, x < 1, 0 < beta, beta < 1, .5 < x/(beta*x^2+1)

 

Warning, solve may not respect assumed property 'real' on 'x/(beta*x^2+1)'.

 

Error, (in type/realcons) too many levels of recursion

 

gs2:=subs(beta=0.6,gs(x));

x/(.6*x^2+1)

(4)

sol:= solve(subs(beta=0.6,fs=0),x,useassumptions) assuming x>1/theta, x<1;

.2514854589, .9665623271

(5)

subs(x=sol[1],gs2);

.2422912423

(6)

 

Download Rootsfind.mw

How can I show all the parameters in title ?

restart;

with(DEtools):with(plots):with(plottools):

 

 

sigma1:=e1*alpha: sigma2:=e2*delta:

g:=x/(1+beta*x^2);
f:=(theta*x-1)*(1-x)*(1+beta*x^2)-y;
h:=alpha*g-z-sigma1;
j:=delta*y-sigma2;

x/(beta*x^2+1)

 

(theta*x-1)*(1-x)*(beta*x^2+1)-y

 

alpha*x/(beta*x^2+1)-e1*alpha-z

 

-delta*e2+delta*y

(1)

 

 

p0:=theta->plot([1/theta,y,y=0..1],linestyle=dash,color= green):
p1:=e1->plot([x,e1,x=0....1.5],color=blue):
q0:=animate(p0,[theta],theta=2...10):
q1:=animate(p1,[e1],e1=0.1..1):
q2:=plot([1,y,y=0..1],linestyle=dash,color= green):
p3:=beta->plot([x,x/(1+beta*x^2),x=0..1.5],color=magenta);
q3:=animate(p3,[beta],beta=0..1.5):

display([q0,q1,q2,q3],view=[0..1.5,0..1]);

proc (beta) options operator, arrow; plot([x, x/(1+beta*x^2), x = 0 .. 1.5], color = magenta) end proc

 

 

 

Download animate_plots.mw

1 2 3 4 Page 1 of 4