sunit

105 Reputation

10 Badges

10 years, 260 days

MaplePrimes Activity


These are questions asked by sunit

Hi,

I am trying to solve a set of homogeneous equations for the non-trivial solutions. Mathematically it is possible to get it. But is there any way to get it in Maple. Please find the attached maple sheet for the question. Please help me regarding this.

Regards

Sunit

restart

with(plots):

with(LinearAlgebra):

eq[1] := diff(x[1](t), t)-x[2](t)

diff(x[1](t), t)-x[2](t)

(1)

eq[2] := diff(x[2](t), t)+2*zeta*beta*x[2](t)+beta^2*x[1](t)+n*psi*(-v*(phi[1](t)-phi[1](t-2*Pi/(n*omega0)))+x[1](t)-x[1](t-2*Pi/(n*omega0)))

diff(x[2](t), t)+2*zeta*beta*x[2](t)+beta^2*x[1](t)+n*psi*(-v*(phi[1](t)-phi[1](t-2*Pi/(n*omega0)))+x[1](t)-x[1](t-2*Pi/(n*omega0)))

(2)

eq[3] := diff(phi[1](t), t)-phi[2](t)

diff(phi[1](t), t)-phi[2](t)

(3)

eq[4] := diff(phi[2](t), t)+2*kappa*phi[2](t)+phi[1](t)+n*(-v*(phi[1](t)-phi[1](t-2*Pi/(n*omega0)))+x[1](t)-x[1](t-2*Pi/(n*omega0)))

diff(phi[2](t), t)+2*kappa*phi[2](t)+phi[1](t)+n*(-v*(phi[1](t)-phi[1](t-2*Pi/(n*omega0)))+x[1](t)-x[1](t-2*Pi/(n*omega0)))

(4)

for k to 4 do eqn[k] := simplify(coeff(map(expand, eval(eq[k], [x[1] = (proc (t) options operator, arrow; x[1]*exp(lambda*t) end proc), x[2] = (proc (t) options operator, arrow; x[2]*exp(lambda*t) end proc), phi[1] = (proc (t) options operator, arrow; phi[1]*exp(lambda*t) end proc), phi[2] = (proc (t) options operator, arrow; phi[2]*exp(lambda*t) end proc)])), exp(lambda*t))) end do

x[1]*lambda-x[2]

 

x[2]*lambda+2*zeta*beta*x[2]+beta^2*x[1]-n*psi*v*phi[1]+n*psi*v*phi[1]*exp(-2*lambda*Pi/(n*omega0))+n*psi*x[1]-n*psi*x[1]*exp(-2*lambda*Pi/(n*omega0))

 

phi[1]*lambda-phi[2]

 

phi[2]*lambda+2*kappa*phi[2]+phi[1]-n*v*phi[1]+n*v*phi[1]*exp(-2*lambda*Pi/(n*omega0))+n*x[1]-n*x[1]*exp(-2*lambda*Pi/(n*omega0))

(5)

A, b := GenerateMatrix([seq(eqn[k], k = 1 .. 4)], [x[1], x[2], phi[1], phi[2]])

A, b := Matrix(4, 4, {(1, 1) = lambda, (1, 2) = -1, (1, 3) = 0, (1, 4) = 0, (2, 1) = beta^2+n*psi-n*psi*exp(-2*lambda*Pi/(n*omega0)), (2, 2) = 2*Zeta*beta+lambda, (2, 3) = n*psi*v*exp(-2*lambda*Pi/(n*omega0))-n*psi*v, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = lambda, (3, 4) = -1, (4, 1) = n-n*exp(-2*lambda*Pi/(n*omega0)), (4, 2) = 0, (4, 3) = -n*v+1+n*v*exp(-2*lambda*Pi/(n*omega0)), (4, 4) = 2*kappa+lambda}), Vector(4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0})

(6)

right_vector := Matrix(4, 1, [r[1], r[2], r[3], r[4]])

right_vector := Matrix(4, 1, {(1, 1) = r[1], (2, 1) = r[2], (3, 1) = r[3], (4, 1) = r[4]})

(7)

junk := MatrixVectorMultiply(subs(lambda = I*omega, A), right_vector)

junk := Matrix(4, 1, {(1, 1) = I*omega*r[1]-r[2], (2, 1) = (beta^2+n*psi-n*psi*exp(-(2*I)*omega*Pi/(n*omega0)))*r[1]+(2*Zeta*beta+I*omega)*r[2]+(n*psi*v*exp(-(2*I)*omega*Pi/(n*omega0))-n*psi*v)*r[3], (3, 1) = I*omega*r[3]-r[4], (4, 1) = (n-n*exp(-(2*I)*omega*Pi/(n*omega0)))*r[1]+(-n*v+1+n*v*exp(-(2*I)*omega*Pi/(n*omega0)))*r[3]+(2*kappa+I*omega)*r[4]})

(8)

junk(1)

I*omega*r[1]-r[2]

(9)

for k to 4 do eqnn[k] := junk(k) end do

I*omega*r[1]-r[2]

 

(beta^2+n*psi-n*psi*exp(-(2*I)*omega*Pi/(n*omega0)))*r[1]+(2*zeta*beta+I*omega)*r[2]+(n*psi*v*exp(-(2*I)*omega*Pi/(n*omega0))-n*psi*v)*r[3]

 

I*omega*r[3]-r[4]

 

(n-n*exp(-(2*I)*omega*Pi/(n*omega0)))*r[1]+(1-n*v+n*v*exp(-(2*I)*omega*Pi/(n*omega0)))*r[3]+(2*kappa+I*omega)*r[4]

(10)

solve({seq(eqnn[k], k = 1 .. 4)}, {seq(r[k], k = 1 .. 4)})

{r[1] = 0, r[2] = 0, r[3] = 0, r[4] = 0}

(11)

``

``

``

 

Download question4.mw

Hi,

I am trying to do a numerical approximate method 'method of multiple scales'. And in doing so I am getting following equation.

restart

junk := -n*v_SDD*x[1](T[0], T[1], T[2])+x[1](T[0], T[1], T[2])+(D[1, 1](x[1]))(T[0], T[1], T[2])+2*kappa*(D[1](x[1]))(T[0], T[1], T[2])+n*v_SDD*x[1](T[0]-tau_1, T[1], T[2])-psi*n*x[1](T[0]-tau_1, T[1], T[2])+psi*n*x[1](T[0], T[1], T[2])

-n*v_SDD*x[1](T[0], T[1], T[2])+x[1](T[0], T[1], T[2])+(D[1, 1](x[1]))(T[0], T[1], T[2])+2*kappa*(D[1](x[1]))(T[0], T[1], T[2])+n*v_SDD*x[1](T[0]-tau_1, T[1], T[2])-psi*n*x[1](T[0]-tau_1, T[1], T[2])+psi*n*x[1](T[0], T[1], T[2])

(1)

evalf(subs(x[1](T[0], T[1], T[2]) = R(T[1], T[2])*sin(omega*T[0]+phi(T[1], T[2])), %))

-1.*n*v_SDD*R(T[1], T[2])*sin(omega*T[0]+phi(T[1], T[2]))+R(T[1], T[2])*sin(omega*T[0]+phi(T[1], T[2]))+(D[1, 1](x[1]))(T[0], T[1], T[2])+2.*kappa*(D[1](x[1]))(T[0], T[1], T[2])+n*v_SDD*x[1](T[0]-tau_1, T[1], T[2])-1.*psi*n*x[1](T[0]-tau_1, T[1], T[2])+psi*n*R(T[1], T[2])*sin(omega*T[0]+phi(T[1], T[2]))

(2)

``


Download question3.mw

Now I need to substitute x_1(T0,T1,T2)=R(T1,T2)sin(omega*T0+phi(T1,T2)) in the expression and evaluate it.  But on substituting, it is not solving for the 'D' operator. In a similar line if I will have a differential term like

D1(x1)(T0-tau_1,T1,T2) and I have to substitute x1(T0-tau_1,T1,T2) then how can i do it?

Please help me regarding it.

Thanks and regards

Sunit

Hi,

It might be a silly question but here it goes. I have a sin function in terms of sin(omega*(T0-T)+Phi) and i need to expand it by keeping omega*T0+phi as a single term. One way is by subs omega*T0+phi as a constant 'c' and then after expanding we can back substitute. But is there any option in expand function itself?

 

Regards

Sunit

Hi,

I have to find the root of an equation corresponding to the maximum absolute value. I am using root finding package to get all the roots. But after getting all the roots i am not able to apply abs function. Maple sheet is attached.

restart

with(plots):

with(LinearAlgebra):

with(DEtools):

with(ColorTools):

Digits := 30

30

(1)

x := proc (t) options operator, arrow; x0*exp(lambda*t) end proc:

phi := proc (t) options operator, arrow; phi0*exp(lambda*t) end proc:

eqm1 := collect(simplify(coeff(expand(diff(x(t), `$`(t, 2))+(2*0)*beta*(diff(x(t), t))+0*x(t)+n*psi*(-v*(phi(t)-phi(t-2*Pi/(n*omega0)))+x(t)-x(t-2*Pi/(n*omega0)))), exp(lambda*t))), {phi0, x0})

(-n*psi*v+n*psi*v*exp(-2*lambda*Pi/(n*omega0)))*phi0+(lambda^2+n*psi-n*psi*exp(-2*lambda*Pi/(n*omega0)))*x0

(2)

eqm2 := collect(simplify(coeff(expand(diff(phi(t), `$`(t, 2))+(2*0)*(diff(phi(t), t))+phi(t)+n*(-v*(phi(t)-phi(t-2*Pi/(n*omega0)))+x(t)-x(t-2*Pi/(n*omega0)))), exp(lambda*t))), {phi0, x0})

(-n*v+n*v*exp(-2*lambda*Pi/(n*omega0))+lambda^2+1)*phi0+(n-n*exp(-2*lambda*Pi/(n*omega0)))*x0

(3)

mode := simplify(evalc(Re(evalc(subs(lambda = I*Omega, solve(subs(x0 = m*phi0, eqm1), m)))))^2+evalc(Im(evalc(subs(lambda = I*Omega, solve(subs(x0 = m*phi0, eqm1), m)))))^2)

-2*n^2*psi^2*v^2*(-1+cos(2*Omega*Pi/(n*omega0)))/(Omega^4-2*Omega^2*n*psi+2*Omega^2*n*psi*cos(2*Omega*Pi/(n*omega0))+2*n^2*psi^2-2*n^2*psi^2*cos(2*Omega*Pi/(n*omega0)))

(4)

A, b := GenerateMatrix([eqm1, eqm2], [x0, phi0])

A, b := Matrix(2, 2, {(1, 1) = lambda^2+n*psi-n*psi*exp(-2*lambda*Pi/(n*omega0)), (1, 2) = -n*psi*v+n*psi*v*exp(-2*lambda*Pi/(n*omega0)), (2, 1) = n-n*exp(-2*lambda*Pi/(n*omega0)), (2, 2) = -n*v+n*v*exp(-2*lambda*Pi/(n*omega0))+lambda^2+1}), Vector(2, {(1) = 0, (2) = 0})

(5)

with(RootFinding):

eq := subs(n = 6, psi = 1000, omega0 = 1.15, v = 0.1e-1, Determinant(A))

6000.94*lambda^2-5999.94*exp(-.289855072463768115942028985507*lambda*Pi)*lambda^2+lambda^4+6000-6000*exp(-.289855072463768115942028985507*lambda*Pi)

(6)

zeros := RootFinding:-Analytic(eq, lambda, re = 0 .. 400, im = -200 .. 200)

0.899769545162895563524511282265e-56, 0.813609592584011756247655681635e-1-20.6993361029378520006643410260*I, .242743338419727199544214811606-34.4961764258358768825593120288*I, .440964962950043888796944083291-100.074138054178692973033664525*I, .107710271188082726666762251538-106.954651646879437684160623413*I, 1.12290283496379505456476079030-62.0290638297730162295171014475*I, .879463466045683309032252293625-93.2168861049771086211729407830*I, 2.54860869821265794971735119535-80.1919866273564551209847942490*I, 1.52678990439144770439544731898-86.4450560720567958301493690195*I, 2.62945288424037545703549470125-75.0161229879790946191171617450*I, 1.68779005203728587549371003511-68.8012471850312399391042105550*I, .776570081405504740452992339900-55.1681878011205261920670466495*I, 0.851171007270465178285429398270e-9+1.00000500045406723708450960132*I, 0.851171007270465178285445699470e-9-1.00000500045406723708450960133*I, 0.874874719902730972066854301075e-2-6.89997772561385443312823760560*I, 0.354201863215292148351069041542e-1-13.7998152076043523748759861636*I, .369195444156713173497807954493-41.3921704506707022569621870947*I, .540047057129385026999638567235-48.2843908783769449582520027744*I, .149078330738225743331408017894-27.5982749361891156626731068484*I, .369195444156713173497807954500+41.3921704506707022569621870948*I, .440964962950043888796944083291+100.074138054178692973033664525*I, .107710271188082726666762251538+106.954651646879437684160623413*I, 1.12290283496379505456476079030+62.0290638297730162295171014475*I, .879463466045683309032252293625+93.2168861049771086211729407830*I, 2.54860869821265794971735119535+80.1919866273564551209847942490*I, 1.52678990439144770439544731898+86.4450560720567958301493690195*I, 2.62945288424037545703549470125+75.0161229879790946191171617450*I, 1.68779005203728587549371003511+68.8012471850312399391042105550*I, .776570081405504740452992339900+55.1681878011205261920670466495*I, 0.813609592584011756247655681660e-1+20.6993361029378520006643410260*I, 0.354201863215292148351069041261e-1+13.7998152076043523748759861634*I, 0.874874719902730972066854301075e-2+6.89997772561385443312823760560*I, .540047057129385026999638567235+48.2843908783769449582520027744*I, .242743338419727199544214811602+34.4961764258358768825593120288*I, .149078330738225743331408017894+27.5982749361891156626731068484*I

(7)

"zeros.select(int 1)"

Error, missing operation

"zeros.select(int 1)"

 

``


Download question.mw

I will be really thankful for the help.

Regards

Sunit

Hi,

Here is my question.


restart

convert(diff(lambda(t-t1), t), diff)

eval(diff(lambda(t2), t2), {t2 = t-t1})

(1)

subs(lamda(t-t1) = sin(t-t1), %)

eval(diff(lambda(t2), t2), {t2 = t-t1})

(2)

``

I am trying to substitute value of lambda(t-t1) further but it is not taking the value.

Thanks in advance.

Regards

Sunit

Download question2.mw

1 2 3 4 5 6 Page 3 of 6