Describe the bug
If the ODE is a function of t, then probsolve_ivp gives the error TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'. Upon further investigation, it turns out that t is passed in as None to the ODE function sometimes. Thus, this will give an error when performing any numerical operator on t. Is there something that I need to change in the ODE function to make it work when it's a function of t? I can post the entire traceback if needed.
To Reproduce
def stiff_ode(t, y):
lambda_val = 2
print(t)
return lambda_val * y + np.exp(-t)
# Initial and final time value
t0 = 0.0
tmax = 1.0
# Initial condition
y0 = np.array([1])
sol = probsolve_ivp(stiff_ode, t0, tmax, y0, algo_order=2, adaptive=True, atol=1e-2, rtol=1e-2)
Expected behavior
There shouldn't be an error and t shouldn't be passed in as None to the ODE function.
Describe the bug If the ODE is a function of
t
, thenprobsolve_ivp
gives the errorTypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
. Upon further investigation, it turns out thatt
is passed in asNone
to the ODE function sometimes. Thus, this will give an error when performing any numerical operator ont
. Is there something that I need to change in the ODE function to make it work when it's a function oft
? I can post the entire traceback if needed.To Reproduce
Expected behavior There shouldn't be an error and
t
shouldn't be passed in asNone
to the ODE function.System: