sloisel / numeric

Numerical analysis in Javascript
http://www.numericjs.com/
Other
1.42k stars 177 forks source link

function passed to ODE solver should be able to accept additional parameters #9

Closed martar closed 11 years ago

martar commented 11 years ago

I would expect to have the posibility to pass additional parameters to function passed to 'dopri' function. It is a case in pyton numpy library's ODe solver: http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.odeint.html

scipy.integrate.odeint allow to pass extra 'args'

martar commented 11 years ago

I added a dopri_param function in my form that does what I need in this commit https://github.com/martar/numeric/commit/0140a245e7632aa1a2be34304b919a3f3545e199.

sloisel commented 11 years ago

At present I have standardized on the "javascript way" of passing "side-parameters", which is to use anonymous functions. I've made an example here:

http://www.numericjs.com/workshop.php?link=885826488246ebee59c28d235735de2c3ed40a009e327ea01b17f45f03249779

martar commented 11 years ago

ok cool, I didn't know this pattern