[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] A question about differential equations
From: |
daly |
Subject: |
Re: [Axiom-developer] A question about differential equations |
Date: |
Sat, 17 Oct 2015 03:44:49 -0500 |
It is rarely the case that algorithms used for hand solutions match
the algorithms used by Axiom (or by computer algebra systems in general).
The Computer Algebra Test Suite (CATS) at:
http://axiom-developer.org/axiom-website/CATS/index.html
has an ODE section (Kamke) which shows Axiom's ODE abilities.
These are presented in three different forms,
* as text files which can be used as input,
http://axiom-developer.org/axiom-website/CATS/kamke0.txt
* as source files which are latex,
http://axiom-developer.org/axiom-website/CATS/kamke0.input.pamphlet
* and as PDFs which are the output of the latex.
http://axiom-developer.org/axiom-website/CATS/kamke0.input.pdf
There are occasions when the Axiom output did not simplify to the
result given in the textbook. At those times I used RewriteRule to
apply simplifications.
Look at, for example:
http://axiom-developer.org/axiom-website/CATS/kamke0.input.pamphlet
for the expression ODE6 (--S 24) which gives an example of using RewriteRule
to manipulate the expression.
ode6 := D(y(x),x) + y(x)*cos(x) - sin(2*x)/2
ode6a:=solve(ode6,y,x)
yx:=ode6a.particular
ode6expr:=D(yx,x) + yx*cos(x) - sin(2*x)/2
sin2rule := rule 2*cos(x)*sin(x) == sin(2*x)
sin2rule ode6expr
http://axiom-developer.org/axiom-website/CATS/kamke1.input.pamphlet
Look at ODE94 (in kamke1) where I use
ode94 := x*D(y(x),x) +a*y(x) + b*x**n
ode94a:=solve(ode94,y,x)
yx:=ode94a.particular
ode94expr := x*D(yx,x) +a*yx + b*x**n
exprule := rule x^n == %e^(n*log(x))
exprule ode94expr
I'm not sure the exact form of the result you're trying to achieve
but it is likely that you can use RewriteRule to get there.
Tim
>In putting Axiom through its paces just recently (yes: Axiom, not a fork!),
>I experimented with the ODE
>
>y''+6y'+5y = 10x^2+4x+4exp(-x)
>
>Now standard techniques (such as I teach my students), produce a solution
>of the form
>
>y = A*exp(-5x)+B*exp(-x)+2*x^2-4*x+4+x*exp(-x).
>
>This is Axiom:
>
>--(View this section in a fixed width font if it isn't shown as such)
>
>(1) -> y:=operator 'y
>(2) -> deq:=D(y(x),x,2)+6*D(y(x),x)+5*y(x)=10*x^2+4*x+4*exp(-x)
>(3) -> sol:=solve(deq,y,x)
> (3)
> [
> particular =
> - x 6 2 - x 5 - 5x - x 2 - 5x
> 4x (%e ) + (10x - 16x + 16)(%e ) - %e %e - 2x %e
> -----------------------------------------------------------------
> - x 5
> 4(%e )
> ,
> - x - 5x
> basis= [%e ,%e ]]
>Type: Union(Record(particular: Expression(Integer),basis:
>List(Expression(Integer)))
>
>--
>of which the particular solution is a bit of a jumble. It doesn't seem to
>be particularly simplifiable:
>
>(4) -> simplifyExp(sol.particular)
>(4) ->
> 2 - 5x - 6x
> (8x - 16x + 16)%e + (4x - 1)%e
> (4) ---------------------------------------
> - 5x
> 4%e
>
>--
>Is there some way I can coerce Axiom into giving a particular solution to
>such a straightforward ODE in a more simplified form?
>
>
- Re: [Axiom-developer] A question about differential equations,
daly <=