ODE solution transfer
- To: mathgroup at smc.vnet.net
- Subject: [mg111419] ODE solution transfer
- From: EF <he.frauendorfer at t-online.de>
- Date: Sat, 31 Jul 2010 02:42:57 -0400 (EDT)
Moin,
for the following sample ODE with the variables a[t] and b[t]
deqns={a'[t]== -k*a[t], a[0]==2,
b'[t]== k*a[t], b[0]==0};
k=0.08;
start=0;end=10;
the lists vars = {a[t],b[t]}
and fvars = {a[t_],b[t_]} are declared.
Doing:
{a[t_],b[t_]}=vars/.NDSolve[deqns,vars,{t,start,end}][[1]]
gives the function values for a[t] and b[t], e.g. a[5] = 1.3406
Using:
fvars=vars/.NDSolve[deqns,vars,{t,start,end}][[1]]
gives no function values for a[t] and b[t], entering a[5] returns
no numeric value. fvars can be plotted however.
The Full Forms of the corresponding expressions show no differences.
I tried Thread, Map, Apply, Set @@@ etc without result.
For ODEs with more than 100 variables, a form like fvars
generated from vars would be useful.
Please suggest a fix, Thanks
E.F.