odes icon indicating copy to clipboard operation
odes copied to clipboard

Set extra parameters for right-hand-side function

Open Huan-Yang opened this issue 7 years ago • 3 comments

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

Huan-Yang avatar Apr 08 '18 11:04 Huan-Yang

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

aragilar avatar Apr 09 '18 01:04 aragilar

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

bmcage avatar Apr 09 '18 06:04 bmcage

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

Huan-Yang avatar Apr 13 '18 10:04 Huan-Yang