List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Numerical solution of ODE
| [MUG] Numerical solution of ODE |
|
Author: PierLuigi Zezza
Posted: Thu, 16 May 2002 21:59:00 +0200
|
>> From: PierLuigi Zezza "pzezza"
Hi,
I am trying to solve numerically an ODE obtained as a linearization of a
nonlinear system along a given solution which is
also obtained by numerical integration.
But something does not go through ... anyone can help
THANKS
gigi
This is my try :
> restart:
> with(DEtools):
# The reference system
> ref1:= diff(x1(t),t) = x2(t);
> ref2:= diff(x2(t),t) = (1-x1(t)^2)*x2(t)-x1(t)+PIECEWISE([1, t <=
.5],[-1, t <= 1],[1, otherwise]);
d
ref1 := -- x1(t) = x2(t)
dt
d
ref2 := -- x2(t) =
dt
/{ 1 t <= .5 \
2 |{ |
(1 - x1(t) ) x2(t) - x1(t) + |{ -1 t <= 1 |
|{ |
\{ 1 otherwise/
# A given solution corresponding to fixed initial condition
> refsol:=dsolve([ref1,ref2,x1(0)=-4/10,
x2(0)=6/10],[x1(t),x2(t)],type=numeric,method=rkf45,relerr=Float(1,2-Digits),
output=listprocedure):
# the two components of the solution as functions of t
> refx1:=proc(t):if type(t,numeric) then rhs(refsol[2])(t) else 'refx1(t)'
fi :end:
> refx2:=proc(t):if type(t,numeric) then rhs(refsol[3])(t) else 'refx2(t)'
fi :end:
# The linearization along the given solution
> lin1:=diff(xx1(t),t)=xx2(t);
> lin2:=diff(xx2(t),t)=(-2*refx1(t)*refx2(t)-1)*xx1(t)+(1-refx1(t)^2)*xx2(t);
d
lin1 := -- xx1(t) = xx2(t)
dt
d
lin2 := -- xx2(t) =
dt
2
(-2 refx1(t) refx2(t) - 1) xx1(t) + (1 - refx1(t) ) xx2(t)
# the solution of the linearized system
>
X_star:=dsolve([lin1,lin2,xx1(0)=1,xx2(0)=0],[xx1(t),xx2(t)],type=numeric,
method=rkf45,relerr=Float(1,2-Digits), output=listprocedure):
Error, (in dsolve/numeric/process_input) indication of the unknown(s)
of the problem {xx1(t), xx2(t)} disagrees with input system {xx1(t),
xx2(t), refx1(t), refx2(t)}
PierLuigi Zezza
"pzezza"
|
[View Complete Thread]
Previous by date: [MUG] Re: Coupled, nonlinear ODEs., Robert Israel
Next by date: [MUG] evaluating _F1 /_F2 in pdsolve o/p, Nagaraj Mahavir
Previous thread: [MUG] DLL, Bguerrieri
Next thread: [MUG] evaluating _F1 /_F2 in pdsolve o/p, Nagaraj Mahavir
|