I have a pretty little NDSolve function that I've finally decked out with manipulatable (by sliders) coefficients, which changes the graph in real time. However, I used dummy equations in making sure I could set up the system I want, which I have as you can see by simply copy-pasting:
Manipulate[
Plot[
Evaluate[{a[t], b[t], c[t]} /.
NDSolve[
{a'[t] == -k1f*a[t] + k1r*b[t],
b'[t] == k1f*a[t] - k1r*b[t] - k2f*b[t],
c'[t] == k2f*b[t],
a[0] == a0,
b[0] == 0.0,
c[0] == 0.0},
{a, b, c}, {t, 0, 1500}, MaxSteps -> 1000, AccuracyGoal -> 10]],
{t, 0, 1500}, PlotRange -> {{0, 1500}, {0, 0.11}},
AxesLabel -> {"Time (Seconds)", "Concentration"},
PlotStyle -> {{Red, Thickness[0.008]}, {Green,
Thickness[0.008]}, {Blue, Thickness[0.008]}}],
{{k1f, 0.01, Subscript[k, 1]}, 0, 0.02},
{{k1r, 0.01, Subscript[k, -1]}, 0, 0.02},
{{k2f, 0.01, Subscript[k, 2]}, 0, 0.02},
{{a0, 0.1, Subscript[a, init]}, 0, .2}]
All I want is to rename my equations (a'[t], b'[t], c'[t]) in the first argument of NDSolve to a nickname, eqns, to simplify looking at them when they aren't the dummy 3 equations but are my real 150 equations, instead.
But eqns = {a'[t] == -k1f*a[t] + k1r*b[t], ... as is done in the first argument of NDSolve above, followed by `NDSolve[z,{a, b, c}, etc.] returns a ridiculous number of errors.
Where am I going wrong?
Answered! For those of you still confused after reading the original question's answer (linked above), please see the comments for a short answer as to how to address my scenario specifically.
eqs[k1f, k1r, a0, k2f]so that you are affecting the variables within the equations themselves when you useManipulate:eqs[k1f_, k1r_, a0_, k2f_] = {a'[t] == -k1f*a[t] + k1r*b[t], b'[t] == k1f*a[t] - k1r*b[t] - k2f*b[t], c'[t] == k2f*b[t], a[0] == a0, b[0] == 0.0, c[0] == 0.0};– Jonathan Shock May 23 '13 at 01:02bigA[t_]) and what I suppose I would calleqns[a'_, b'_, c'_, a_. b_, c_]... I will sit on this and update as I progress. – Ghersic May 23 '13 at 05:50eqnsas a function of those parameters being changed with manipulate that I want to place withinNDSolve, noteqnsas a function of the dependent variables withinNDSolve. Thank you both. I see the relevance of what you linked as well, Mr. Wizard. – Ghersic May 23 '13 at 05:53