a problem with linear system of 4 differential equation
Subject: a problem with linear system of 4 differential equation
From: van Nek
Date: Mon, 25 Aug 2008 21:44:09 +0200
Hi,
it is quite normal also to send a copy of your response to the mailing list. So the other
participiants might be interested in your answer.
There are different ways to define a function. Use e.g.
foo(z) := 3*z^2+5$
if the right side of this definition is explicitely given. Maxima doesn't evaluate here.
In your example you want to pull out an expression from an equation inside of a list. So
evaluation is needed. In this case you might want to use define. The result shows the
explicite := definition.
(%i15) --> see my previous post below
(%i16) define(u(z), rhs(sol[1][1]));
(%o16) u(z):=(2*p*L*z^4+(-5*p*L^2-12*gam^2*p)*z^3+(3*p*L^3+12*gam^2*p*L)*z^2)
/(48*d*L)
u(z) := ''( rhs(sol[1][1] );
would do the same (two single quotes!)
Now you can use the function definition to prove the boundary condition.
(%i17) ratsimp(u(L));
(%o17) 0
Welcome to Maxima
Volker van Nek
Am 25 Aug 2008 um 21:46 hat mssivava mssivava geschrieben:
>
>
>
> Hi Volker,
>
> I calculated with mathematica also. And the result is the same with your code. Thank you very
> much for your kind attention. You helped me so much.
>
> If I don't disturb you, may I ask one more question? How can I take for example u(z) from the
> result.?
>
>
>
>
> 2008/8/25, van Nek <van.nek at arcor.de>:
> Hi,
>
> the function desolve can solve your initial value problem. View documentation by typing
> ? desolve
> for more examples. And there is a chapter on differential equations in the manual.
>
> (%i1) display2d:false$
> (%i2) eqn_1: 'diff(u(z),z,1)+om(z)=0$
> (%i3) eqn_2: 'diff(om(z),z,1)-m(z)/d-(gam^2*p/d)=0$
> (%i4) eqn_3: 'diff(m(z),z,1)-t(z)=0$
> (%i5) eqn_4: 'diff(t(z),z,1)+p=0$
> (%i6) atvalue(u(z),z=0,0)$
> (%i7) atvalue(om(z),z=0,0)$
> (%i8) sol: desolve([eqn_1,eqn_2,eqn_3,eqn_4], [u(z),om(z),m(z),t(z)])$
> (%i9) sol: ratsimp(sol)$
>
> For better readability I omit Maxima's response here. By replacing the $ by ; you'll see the
> answers.
>
> The boundary values you can use to eliminate the unknown m(0) and t(0).
>
> (%i10) bc_1: subst(L,z,rhs(sol[1]))=0$
> (%i11) bc_2: subst(L,z,rhs(sol[3]))=0$
> (%i12) sol: eliminate(append(sol,[bc_1,bc_2]),[m(0),t(0)])$
> (%i13) sol: solve(sol,[u(z),om(z),m(z),t(z)])$
>
> L is introduced. I declare z to be the main variable and simplify.
>
> (%i14) declare(z,mainvar)$
> (%i15) sol: ratsimp(sol)$
>
> I hope you like the result.
>
> Volker van Nek
>
>
> Am 25 Aug 2008 um 8:26 hat mssivava geschrieben:
>
> >
> > Hi everyone, I have 4 linear system of differential equations which are
> > eqn_1:diff(u(z),z,1)+om(z)=0; eqn_2:diff(om(z),z,1)-m(z)/d-(gam^2*p/d)=0;
> eqn_3:diff(m(z),z,1)-
> > t(z)=0; eqn_4:diff(t(z),z,1)+p=0; My initial conditions are u(0)=0, om(0)=0 My boundary
> conditons
> > are u(L)=0, m(L)=0 I would like to find u(z), om(z), m(z) and t(z) So, I tried to use desolve
> > function to solve this equation system. But I couldn't. Can anyone help me to solve this
> system.
> > Thanks in advance
> >
> > View this message in context: a problem with linear system of 4 differential equation
> > Sent from the Maxima mailing list archive at Nabble.com.
> >
>
>
>
>