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 post and replies

Return to the Modeling Tips & Help thread
Login to post to this thread

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.]


Replies to Mathematical Function Use in ODEs???

Re: Mathematical Function Use in ODEs??? -
Vasudeva Rao Aravind
5 Posts

Yes. For example if you want to say that dx/dt is sin(w*t), your command should read

dx/dt=Math.sin(w*t)

Hope it helps.



Re: Mathematical Function Use in ODEs??? -
Wolfgang
192 Posts

The OSP parser within EJS can be used used to compute the ODE rate.  See how this is done in the Barrier Scattering model.

http://www.compadre.org/osp/items/detail.cfm?ID=10220



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book