APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Modeling Tips & Help

Return to the EJS Modeling forum
Login to post to this thread

Iterating with ODE solving
Ioannis Vourkas
4 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!

Current Replies - View all
Re: Iterating with ODE so...   (Francisco Esquembre - )
Re: Re: Iterating with OD...   (Wolfgang - )
Page of Code Vs Page of ODEs in EJS Evolution
Ioannis Vourkas
4 Posts

Hi! I 've been using EJS ever since 2009 when I was in Spain, and I'd like to encourage you to keep up doing such a briliant work. Nevertheless, this is the first time I use this forum...

I 'd like to make a question regarding the Evolution page in EJS. First of all, is there any problem if someone uses both pages of code and ODEs in the same simulation? In most of the cases I use a page sequence like...

Page of Code--Page of ODEs--Page of Code--Page of ODEs ... etc

so I organize my preliminary code before specific ODEs whenever it is necessary. Is this OK? (I guess I could use the preliminary code section of ODE pages instead...).

Moreover, let's say that I want to simulate a 2D grid of nxm devices and need a DE to describe the response of each device, in every time step. Is there any way to do this without having to declare nxm different DEs? Is there any kind of iteration I could use instead? (Maybe PJ could be helpful?) The devices are identical, so the DEs are all the same too, except for some different coefficient values that I pass as parameters to the method I use in the ODEs page.

Thank you very much in advance.


Current Replies - View all
Re: Page of Code Vs Page ...   (Francisco Esquembre - )
Re: Re: Page of Code Vs P...   (Ioannis Vourkas - )
Re: Re: Re: Page of Code ...   (Francisco Esquembre - )
automatically stop a simulation
1 Posts


Is there any way to define a final time for automatically stop a simulation when the simulation time reaches it?

Thank you in advance

Current Replies - View all
Re: automatically stop a ...   (Francisco Esquembre - )
Input from user through textbox on frame
1 Posts

i want to get input from the user through text box and then again restart the simulation with updated valuse

can anyone help me in doing this

Current Replies - View all
Re: Input from user throu...   (Francisco Esquembre - )
Fixed Function Plotter
Ronald Modesitt
2 Posts

I am following the Fixed Function Plotter example in chapter three of Modeling Science: From Free Fall to Chaos.

My graphs appear correctly, however, the trace function connects the end points of the graph (straight line) for both sin(x)/x and sin(x). What parameter do I change to eliminate this effect?

Many thanks for EJS. What a fun environment to re-learn physics.


Current Replies - View all
Re: Fixed Function Plotte...   (Francisco Esquembre - )
Re: Re: Fixed Function Pl...   (Ronald Modesitt - )
Zach Wilson
1 Posts

Does anyone know if there is a way to utilize parallel computing or if there is going to be a version dedicated to this?

Current Replies - View all
Re: Parallelization   (Francisco Esquembre - )
Re: Parallelization   (Francisco Esquembre - )
Mathematical Function Use in ODEs???
Nolan Nicholas
1 Posts

Does anyone know if it is possible to use named functions (e.g. sine) in the ODE "evolution"?  

[I want to simulate a "particle on a hoop" under the influence of a separate external force field.]

Current Replies - View all
Re: Mathematical Function...   (Vasudeva Rao Aravind - )
Re: Mathematical Function...   (Wolfgang - )
OSP Projects:
Open Source Physics - EJS Modeling
Physlet Physics
Physlet Quantum Physics
STP Book