views:

57

answers:

1

hi every one! when i solve numerically a system of two differential equations:

s1:=diff(n[Di](t), t)=...;
s2:=diff(n[T](t), t)=...;
ics:={...};   #initial condition.
sys := {s1, s2, ics}: 
sol:=dsolve(sys,numeric);

with respect to "t",then the solution (for example)for "t=4" is of the form, sol(4):

[t=4, n1(t)=const1, n2(t)=const2].

now, how is possible to use values of n1(t) and n2(t) for all "t"'s in another equation, namely "p", which involved n1(t) or n2(t)(like: {p=a+n1(t)*n2(t)+f(t)},where "a" and "f(t)" are defined), and to plot "p" for an interval of "t"?

A: 

Perhaps an example will help.

s1:=diff(n1(t), t)=sin(t);
s2:=diff(n2(t), t)=cos(t);
ics:={n1(0)=1,n2(0)=0}:
sys := {s1, s2} union ics:
sol:=dsolve(sys,numeric,output=listprocedure);
N1:=eval(n1(t),sol);
N2:=eval(n2(t),sol);
N1(0);
N1(1.1);
N2(0);
N2(1.1);
p := 11.3 + N1*N2 + tan:
plot(p, 0..1.1);

You might look at the DEplot routine, which is specialized for plotting ode solutions.

acer