Discussion:
[Maxima-discuss] Third order differential equations
Vidhu Antony
2016-03-13 09:23:47 UTC
Permalink
Is it possible to compute third order differential equations in maxima ?
Michel Talon
2016-03-13 09:58:18 UTC
Permalink
Post by Vidhu Antony
Is it possible to compute third order differential equations in maxima ?
What do you mean by "compute"?
If you mean numerically solve, then third order is no different to first
order.
--
Michel Talon
David Billinghurst
2016-03-13 10:15:20 UTC
Permalink
Post by Vidhu Antony
Is it possible to compute third order differential equations in maxima ?
The function desolve will solve systems of linear equations. It can
therefore be used to solve a third order linear homogeneous ordinary
differential equation by converting it into a system of three first
order ODEs.

Maxima doesn't have any routines for other third order ODEs.
Jaime Villate
2016-03-13 20:06:26 UTC
Permalink
Post by David Billinghurst
Maxima doesn't have any routines for other third order ODEs.
He didn't say whether he's looking for analytical solutions or numerical
solutions.
Jaime
Aleksas Domarkas
2016-03-14 08:51:17 UTC
Permalink
Post by Vidhu Antony
Is it possible to compute third order differential equations in maxima ?
Some examples of third order differential equations

(%i22) kill(all)$
(%i1) load(odes);
(%o1) "C:/Program Files
(x86)/Maxima-sbcl-5.36.1/share/maxima/5.36.1/share/contrib/odes/odes.mac"

1. y''' + 3y' - 4y = 0
(%i2) odeL('diff(y,x,3)+3*'diff(y,x)-4*y=0,y,x);
(%o2)
y=%e^(-x/2)*sin((sqrt(3)*sqrt(5)*x)/2)*C3+%e^(-x/2)*cos((sqrt(3)*sqrt(5)*x)/2)*C2+%e^x*C1

2. y''' - 3y' + y = 0
(%i3) odeL('diff(y,x,3)-3*'diff(y,x)+y=0,y,x);
(%o3)
y=%e^(2*cos((8*%pi)/9)*x)*C3+%e^(2*cos((4*%pi)/9)*x)*C2+%e^(2*cos((2*%pi)/9)*x)*C1

3. y''' + y = x*exp(x)*sin(x)^2
(%i4) odeL('diff(y,x,3)+y=x*exp(x)*sin(x)^2,y,x);
(%o4)
y=%e^(x/2)*sin((sqrt(3)*x)/2)*C3+%e^(x/2)*cos((sqrt(3)*x)/2)*C2+%e^(-x)*C1+((26*x-189)*%e^x*sin(2*x)+(130*x-48)*%e^x*cos(2*x)+(676*x-1014)*%e^x)/2704

4. y''' + 4y'' - 5y' = 0, y(0)=4, y'(0)=-7, y''(0)=23
(%i5) odeL_ic('diff(y,t,3)+4*'diff(y,t,2)-5*'diff(y,t)=0,y,t,[0,4,-7,23]);
(%o5) y=-2*%e^t+%e^(-5*t)+5

5. x^3*y''' - x*y' - 3*y = x^2
(%i6) eq:x^3*'diff(y,x,3)-x*'diff(y,x)-3*y=x^2;
(%o6) x^3*('diff(y,x,3))-x*('diff(y,x,1))-3*y=x^2
(%i7) odecv(x=exp(t),eq,y,x);
(%o7) 'diff(y,t,3)-3*('diff(y,t,2))+'diff(y,t,1)-3*y=%e^(2*t)
(%i8) odeL(%,y,t);
(%o8) y=sin(t)*C3+cos(t)*C2+%e^(3*t)*C1-%e^(2*t)/5
(%i9) solution:subst(t=log(x),%);
(%o9) y=sin(log(x))*C3+cos(log(x))*C2+x^3*C1-x^2/5

6. x*y''' - y'' = 0
(%i10) kill(alll)$
(%i11) derivsubst:true$
(%i12) eq:diff(y(x),x,3)- diff(y(x),x,2)=0$
(%i13) tr:diff(y(x),x)=u(x);
(%o13) 'diff(y(x),x,1)=u(x)
(%i14) itr:reverse(tr);
(%o14) u(x)='diff(y(x),x,1)
(%i15) eq1:subst(diff(y(x),x)=u(x),eq);
(%o15) 'diff(u(x),x,2)-'diff(u(x),x,1)=0
(%i16) ode2(eq1,u(x),x);
(%o16) u(x)=%k1*%e^x+%k2
(%i17) subst(itr,%);
(%o17) 'diff(y(x),x,1)=%k1*%e^x+%k2
(%i18) ode2(%,y(x),x);
(%o18) y(x)=%k1*%e^x+%k2*x+%c
or
(%i19) load(odes)$
(%i20) odeC(eq,diff(y(x),x),x);
(%o20) 'diff(y(x),x,1)=%k1*%e^x+%k2
(%i21) integrate(%,x);
(%o21) y(x)=%k1*%e^x+%k2*x+%c2

best
Aleksas Domarkas

Loading...