Comments by Nikolaos I. Ioakimidis
School of Engineering, University of Patras, Patras, Greece
ioakimidis@otenet.gr
on the following message by Prof. Neil E. Klepeis follow his message.
>[Maxima] DESOLVE for linear ODE's with CC
>Neil Klepeis nklepeis@uclink4.berkeley.edu
>Wed, 28 Aug 2002 12:55:24 -0700
>Greetings,
>A few messages on this list from Jay Belanger in April 2002 state that:
>[...]
>> Desolve uses the LaPlace transform to solve odes, so it really only
>>works well for linear odes.
>[...]
>> So desolve really only works with linear odes with constant
>> coefficients.
>I have a system of three linear DE's with constant coefficients, but
>still get the result in terms of an inverse Laplace transform (ILT):
>GCL (GNU Common Lisp) \ Version(2.4.1) Thu Apr \ 4 10:08:23 CST 2002
>Maxima 5.6 Thu Apr 4 10:08:07 CST 2002 (with enhancements by W.
>Schelter). [All on Linux/Intel]
>EQN1:'DIFF(CA(T),T)-K10+CA(T)*K11-CB(T)*K12-CC(T)*K13=0;
>EQN2:'DIFF(CB(T),T)-K20+CB(T)*K22-CA(T)*K21-CC(T)*K23=0;
>EQN3:'DIFF(CC(T),T)-K30+CC(T)*K33-CA(T)*K31-CB(T)*K32=0;
>ATVALUE(CA(T),T=0,CAi);
>ATVALUE(CB(T),T=0,CBi);
>ATVALUE(CC(T),T=0,CCi);
>DESOLVE([EQN1,EQN2,EQN3],[CA(T),CB(T),CC(T)]);
>[The result in terms of ILT and LVAR is very big so I won't give it here.]
>My math is a bit rusty, but shouldn't this be pretty easy to solve? A
>similar *two* equation system is solved with no problems. But it chokes
>on the three coupled equations given above. If it's any consolation,
>Mathematica also seems to choke above two equations (which may suggest I
>am not specifying the problem correctly (?) ).
>Neil
>--
______________________________________________________
>Neil E. Klepeis, UC Berkeley, School of Public Health,
>and Lawrence Berkeley National Laboratory,
>Berkeley, CA USA. Voice: 831-768-9510
______________________________________________________
Comments on the above message by Nikolaos I. Ioakimidis
School of Engineering, University of Patras, Patras, Greece
ioakimidis@otenet.gr
______________________________________________________
Greetings,
[At first, please do forgive me for my intervention. I do not know whether
I am entitled to do so (not being a member of the Maxima interest list) or
not.
Please, delete this message from the Maxima Archives and send me a notice
not to intervene again in case I am not entitled to do so. (My experience
with
Maxima is extremely short!) Many thanks in advance! Yet, I hope I have
the right to send you my questions even if I am not a member of the Maxima
list. Is this the case? Now I take the liberty to proceed now to my
comments.]
It is true that DESOLVE uses the Laplace transform for the solution of
linear
differential equations with constant coefficients such as the above ones
and,
therefore, in principle, it could work and solve the above system of three
linear differential equations with three proper initial conditions (at T=0)
as is
here the case.
The problem is simply that since we have three first-order differential
equations after the application of the Laplace transform and the solution
of the resulting system of three linear algebraic equations for the unknown
Laplace transforms we get a factor in the denominator (of all three
transforms), which is a cubic polynomial (resulting from the determinant
of the system of the equivalent algebraic equations) of the general form
p(s):=a*s^3+b*s^2+c*s+d
which is not easy at all to invert (with so many, 12, parameters in the
system of differential equations). In fact, Maxima cannot invert
even the Laplace transform 1/p(s) (with only four parameters)
even much simpler Laplace transforms such as
1/(s^3+s^2+1), 1/(s^3+s+1) and 1/(s^4+1)
with no parameter at all (although, to be sincere, the last of them is
not extremely difficult to invert . . .)
Theoretically speaking, Maxima knows to solve the full
cubic equation p(s)=0 and, therefore, in principle, it could
be able to proceed. But in such a case, the outcome would
be extremely complicated, perhaps 10 or even 100 pages
long with 12 parameters appearing in the system of differential
equations. Therefore, Maxima does not attempt to proceed
and this seems to be a wise behavior. Such a so complicated
solution, even if it could be found, perhaps after one CPU hour,
it would be so long that it would be useless. (Of course, this is
not the case for a quadratic polynomial, whose two roots are
rather simple even in a symbolic form and, therefore, correctly
Maxima found easily the solution .)
>From a somewhat heretic point of view, I would like to
suggest that in the case of no parameters at all (here we
have 12 K-parameters), i.e. in the case that all of these
K-parameters get numerical values, then, perhaps, the code
of ILT could be expanded a little so that it could proceed
probably by making use of the ALLROOTS standard
Maxima's command, find these (real of complex) roots
numerically and, next, go on with partial fraction expansions
and inversion of the Laplace transform. This means that just
an approximate solution of the system of differential equations
could be obtained and this is not desirable in Maxima. (Perhaps,
it could also lead to an incorrect solution in very rare cases
due to the approximations to the roots. This is the advantage
of computer agebra systems: in general, exact results, no errors).
The conclusion is that Maxima should be expected to
proceed (by using DESOLVE) to the task of finding a
solution whenever there is a solution and this is reasonably
short and this is really the case. But with 12 parameters
(even with one or two) in the present system theoretically
there is a closed-form solution, but this is so complicated
and so long that practically there is of no help and, therefore,
correctly Maxima does not proceed to find it.
On the other hand, for no parameters, as was already mentioned,
Maxima could proceed to an approximation to the solution (by using
the ALLROOTS command, etc.), but this has to be included
in the code of ILT and, in extremely rare cases, it might lead to
somewhat incorrect results. Yet, this policy (to proceed to
approximations) is contrary to the general design of most
computer algebra systems including Maxima (and Mathematica
too as far the InverseLaplaceTransform command is concerned,
and Maple, etc.).
Of course, undoubtedly, the physical problem has (most probably)
formulated correctly and this is also (surely) the case with the Maxima
commands. The difficulty is simply that this physical problem has no
simple solution and, therefore, Maxima should not be expected to find
such a (simple) solution.
Finally, perhaps, Maxima could be programmed to assume the values
of the three roots of the cubic polynomial p(s) being s[1], s[2] and s[3]
(essentially displaying but, next ignoring the related complicated formulae
in the further results) and going on with these s-symbols. This is
completely
possible and reasonable, exactly as is done by humans, but I feel it has to
be programmed with respect to the ILT command as has been the case
elsewhere in Maxima.
Kindest regards,
Nikos