-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow arguments to f and G functions #8
Comments
Thanks, I think that is a useful suggestion, so that we can provide an interface as close to |
Hey there! Has any progress been made on this addition, would really appreciate it :) |
In the current version, it is easy to achieve the same goal by using a function closure, so it is not a very high priority. |
@mattja can you provide an example using the function closure? |
import numpy as np
import sdeint
def close(func, *args):
def newfunc(x, t):
return func(x, t, *args)
return newfunc
tspan = np.linspace(0.0, 5.0, 5001)
x0 = 0.1
def f(x, t, a, b):
return -(a + x*b**2)*(1 - x**2)
def g(x, t, a, b):
return b*(1 - x**2)
args = (1.0, 0.8)
result = sdeint.itoint(close(f, *args), close(g, *args), x0, tspan) |
odeint
hasargs=[]
for this purpose. In case of sdeint we'd possibly need two separate parameters,argsf
andargsG
.The text was updated successfully, but these errors were encountered: