I currently have a list of ~150 autonomous ODE's that I need to be able to work with using NDSolve
. Fortunately I already have them formatted in plaintext, which leaves how to best manipulate them within Mathematica as the remaining task.
Each equations is of the form
a'(t) = f(t)
, b'(t,a) = f(t,a)
, c'(t,a,b) = f(t,a,b)
, or
(Edit: for example)
c'_6 = kf*(c_1 + mu*c_5) - 2*c_6 + mu*kd^2*c_7 - kd^2*c_6
with
c'_7 = kf*(c_1 + mu*c_6) - 2*c_7 + kd^2*c_8 + kd^2*c_7
and
c'_8 = kf*(c_1 + (mu*c_7 - 2*c_8) + kd^2*c_9 + kd^2*c_8
, etc.
where the c'_n (or prime) denotes derivative with respect to time of that equation (labelled c) up until c_150. Each subsequent equation involves the previous functions whose derivatives are given.
My best idea as to how to organize this would be to make a VERY long c = {eqn1RHS,eqn2RHS,...,eqniRHS}
and either list the entirety of each equation within this list, then indexing it by Part
or c[[77]]
if, say, equation 77 is needed.
My question is simple. Within the context of NDSolve and numerical integration, does this seem to the learned of you to be the best way to efficiently import large systems of equations for future manipulation, accessible individually if the need be?
Thank you. (L/RHS = Left/Right Hand Side)
Edit:
See the comments. As suggested, this method is appropriate if (as suggested in the answer) the appropriate syntax is given for which parameters are implicit functions of time.
equations = {functions}
for the list of functions and their initial conditions, but haven't had time to troubleshoot the errors properly, so hearing you say it's feasible is good. The purpose of this question was to make sure that indexing like this, ie. usingz[[n]]
with NDSolve and obtain equation-specific quantities of interest? $\endgroup$