This is driving me nuts: I'm trying to control the parameters for a relatively large system of ODEs using Manipulate.
With[{todo =
Module[
{sol, ode, timedur = 40},
ode = Evaluate[odes /. removeboundaries /. moieties];
sol = NDSolve[Join[ode, init], vars, {t, 0, timedur}];
Plot[Evaluate[c[1][t] /. parms] /. sol, {t, 0, timedur}]
],
controls =
Sequence @@
Table[{{parms[[i]][[1]], parms[[i]][[2]]},
0, (3*parms[[i]][[2]])}, {i, 1, Length[parms]}]},
Manipulate[todo, controls, ContinuousAction -> False,
ControlPlacement -> Bottom]]
The solve step, in which sol is created, performs successfully. When trying to make a Plot from this however, I get all kinds of errors like
NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.`
Although NDSolve runs fine when Plot is commented out! Note that this code relies on global variables defined elsewhere in the script. I should also add that the code inside the Module[] works when copied to a fresh cell.
Could someone help me out?
Thanks!!