Modeling Tips & Help
post and replies
Return to the Modeling Tips & Help thread
Login to post to this thread
Iterating with ODE solving
 Oct 18, 2012 at 5:28PM

Ioannis Vourkas
3 Posts

Hi again,
I am writing to ask if you have any recommendation regarding, how one might manage to use a specific ODE for multiple types of systems whose functionality is described in part by the same ODE.
i.e. In case of having a mesh grid of nodes, where at each node the same ODE applies, though the current values of the state variables are different. Thus, instead of defining as many ODEs as the nodes, should I iterate and step the solver for each node or is there any other possible way to do it?
A student of mine recently defined as state variable a cell of a table, e.g. as follows: d(w[i]) / dt and thinks that the solver tries to iterate within all cells of table w[] ...
Is this some kind of a bug or is it really what it does in case of having such a state variable declaration?
Thanks in advance!

Re: Iterating with ODE solving  Oct 18 2012 5:41PM

Francisco Esquembre
182 Posts

Ioannis,
The ODE editor of EJS can very well handle differential equations where one or more of the states are ondimensional double arrays.
Hence, what your student did is perfectly correct.
In your case, define state arrays where each entry is the state of a given node in th grid, and define the corrresponding ODE. It will work.
As an example, see how array states are used to solve the motion of several balls in a box in the model at http://www.compadre.org/osp/items/detail.cfm?ID=8307
Paco

Re: Re: Iterating with ODE solving  Oct 18 2012 5:53PM

Wolfgang
86 Posts

The chain of coupled oscillators is another model that solved an array of ODEs.
http://www.compadre.org/osp/items/detail.cfm?ID=8263

