Skip to content
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

Set extra parameters for right-hand-side function #75

Open
Huan-Yang opened this issue Apr 8, 2018 · 3 comments
Open

Set extra parameters for right-hand-side function #75

Huan-Yang opened this issue Apr 8, 2018 · 3 comments

Comments

@Huan-Yang
Copy link

Hi All,
I wondered whether we set parameters for rhs function in scikits.odes.ode, something similar to sicpy: scipy.integrate.ode.set_f_params.
I have tried to set parameters as global ones which works indeed. However, I still want to know whether I can set parameters more explicitly because that will probably make easier in some cases e.g when multiple cores are used for different sets of parameter values. Thanks.
Regards,
Huan

@aragilar
Copy link
Collaborator

aragilar commented Apr 9, 2018

This is currently solver dependent, you'll need to look at the individual solver documentation for working out how to do this.

@bmcage
Copy link
Owner

bmcage commented Apr 9, 2018

This is python. Use an object and a member function for the rhs, so self.f_rhs
Then in self.f_rhs, call your real right hand function, with extra parameters: self.extra_par_1, ....

@Huan-Yang
Copy link
Author

Thanks. For cvode, https://github.com/bmcage/odes/blob/975f20b5ef07ed013900ec0182a9e18d7a66ef90/scikits/odes/sundials/cvode.pyx indeed defines in set_options(self, **options).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants