ofxODE -- ordinary differential equation simulation

Hi Guys,

ofxODE is a simple backend for simulating systems of differential equations, and thought someone might be interested in it. Equations can be concisely specified, and ofxODE will keep track of the variables as you step forward in time. Parameters, values, and equations can be modified on the fly.

Attached is an image of the Lorenz Attractor ( http://en.wikipedia.org/wiki/Lorenz-attractor ), from the example app. You can get pretty cool dynamics from simple sets of equations. However, most existing simulation packages are aimed repeated trials of a given system, rather then any sort of dynamic interaction. ofxODE should make it simpler to interact with simulations…

git the code:

https://github.com/amzuko/ofxODE

Andrew

looks awesome! what kind of algorithm are you using? how precise is it?

thanks! Everything’s done with Euler’s method ( http://en.wikipedia.org/wiki/Euler-integration ), which is supposed to have a few problems numerical stability – I haven’t run into any yet, but YMMV. The delta-t for the example simulation is relatively long, in that the line segments that compose the curve are visible, but that parameter is easily changed. Smaller values will yield more precise results.

i see. i just forked it, maybe i can add the midpoint method some time soon.

your repo structure is quite strange, i got to admit. for example, your addon source code is in the repo twice (including the example), and you included compiled libs. a nice .gitignore file would be useful.

Live and learn – I’ll get that cleaned up.

sure. :roll: )

  
*.bak  
*~  
*#  
*.swp  
*.layout  
*.depend  
*.mo  
*.pot  
  
# ignore Mac OS X finder metadata files  
.DS_Store  
  
# no CVS or SVN  
CVS/  
.svn/  
  
bin/  
.frag  
.xml  
  
# general generated data  
*.a  
*.o  
*.dylib  
*.d  
  
# XCode specific files  
build/  
*.mode1v3  
*.pbxuser  
*.perspectivev3  
xcuserdata/  
  
# Compiled source #  
###################  
*.com  
*.class  
*.dll  
*.exe  
*.so  
  
# Packages #  
############  
# it's better to unpack these files and commit the raw source  
# git has its own built in compression methods  
*.7z  
*.dmg  
*.gz  
*.iso  
*.jar  
*.rar  
*.tar  
*.zip  
  
# Logs and databases #  
######################  
*.log  
*.sql  
*.sqlite  
  
# OS generated files #  
######################  
.DS_Store?  
ehthumbs.db  
Icon?  
Thumbs.db  

ok, made it compile on linux, added gitignore and linux c::b files, pushed everything to my github repo.

I think I see now why you implemented the Euler method first. :? gotta leave that for (much?) later…

hey guys,

I found this while running our github scripts today ( see http://forum.openframeworks.cc/t/self-discovering,-self-documenting-ofxaddons/7909/0 ) but on os x the example just returns:

cur val snan nan nan for x y and z

Any idea why it breaks? seems like a really useful add on and would want to play,

i’ll try to take a look tonight, but can’t promise anything, I was in over my head before with this. :smiley:
“nan” would be “not a number”, so maybe a problem with the starting numbers?