how to solve this differential equation



(0) The following solves your DEs. Algorithmically, the method is
identical to the Laplace transform. The final part of the calculation
(the stuff involving zip) is a check (always check your work).

(1) After finding the solution, you may need to use untellrat.

(2) The nullspace function and the tellrat mechanism work together (I
think), but it's an undocumented feature of nullspace (there is an
example of using tellrat together with nullspace).

(3) Maybe you would like to generalize this method and write a solver
for constant coefficient linear DEs that is better than desolve. If I
were to do this, I might not use tellrat--I'm not sure that I trust
tellrat to work correctly with linsolve.

(4) The matrix_exp function can't solve this problem--after generating
algebraic expressions for the eigenvalues, the calculation is unable
to finish. There are other matrix exponential functions in Maxima that might
work. I didn't try them.

(5) It might be helpful to the Maxima list if we knew something about why you 
are solving these particular equations.

(6) If you need an explanation of the method used here, I suggest that you 
work the homework questions in the first Chapter of "Perturbation Theory for 
Linear Operators," by Tosio Kato.

/*---start--*/

deqs : [diff(f(s),s)=-sqrt(3)*g(s)*k, 
?? ? ? diff(g(s),s)=k*(sqrt(3)*f(s)-2^(3/2)*h(s)), 
?? ? ? diff(h(s),s)=k*(2^(2/3)*g(s)-3*l(s)), 
?? ? ? diff(l(s),s)=3*k*h(s)];

deqs : map(lambda([s], rhs(s)-lhs(s)),deqs);
algebraic : true$
deqs, f(s) : pf * exp(z*s), g(s) := pg ?* exp(z*s), ?h(s) := ph ?* exp(z*s), ?l(s) := pl ?* exp(z*s),diff$
eqs : ratexpand(%/exp(s*z));
m : coefmatrix(eqs,[pf, pg, ph, pl]);
eigen_cond : ratexpand(determinant(m));
eigen_cond : first(solve(eigen_cond,z^4));
tellrat(eigen_cond);
nullspace(m);
cl : first(%);
rreduce('addcol, makelist(subst(z = concat(z,i) , cl) * exp(concat(z,i)*t),i,1,4));
smat : % . matrix([f610],[0],[1/2*sqrt(3)*k*f610/sqrt(2)],[0]);
f(t) := ''(part(smat,1,1));
g(t) := ''(part(smat,2,1));
h(t) := ''(part(smat,3,1));
l(t) := ''(part(smat,4,1));
zip : ev(deqs,diff,ratexpand);
[subst(z = z1, eigen_cond), subst(z = z2, eigen_cond), subst(z = z3, eigen_cond), subst(z = z4, eigen_cond)];
subst(%, zip);
ratexpand(%);

/*---end---*/

--Barton

-----maxima-bounces at math.utexas.edu wrote: -----

>I?got?problem?to?solve?this?differential?equation,?hope?some?one?can?help
>me?on?thishere?my?code?problem?and?maxima?code
>------------------------------
>eq1:diff(f(s),s)=-sqrt(3)*g(s)*k$eq2:diff(g(s),s)=k*(sqrt(3)*f(s)-2^(3/2)*
>h(s))$eq3:diff(h(s),s)=k*(2^(2/3)*g(s)-3*l(s))$eq4:diff(l(s),s)=3*k*h(s)$
>atvalue(f(s),s=0,f610)$
>atvalue(g(s),s=0,0)$atvalue(h(s),s=0,1/2*sqrt(3)*k*f610/sqrt(2))$atvalue(l
>(s),s=0,0)$
>desolve([eq1,eq2,eq3,eq4],[f(s),g(s),h(s),l(s)]);