-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
dictionary support for de.jit #120
Comments
I think the problem here is that Specifically, I believe that when you perform a As a workaround, perhaps don't pass the models in as parameters, instead embed them in the function. Does this work for you? def make_combined_function(pvder_dict):
def combined_model(dy,y,p,t):
"""Concatenate ODE residuals from multiple models of same type"""
i = 0
for dss_id in pvder_dict:
for node in pvder_dict[dss_id]:
for der_id in pvder_dict[dss_id][node]:
sim = pvder_dict[dss_id][node][der_id]["sim"]
nEqs = sim.DER_model.n_ODE
start_index = i * nEqs
end_index = (i + 1) * nEqs
dy[start_index:end_index] = sim.ODE_model(y[start_index:end_index],t)
i += 1
return dy
return combined_model
func = de.ODEFunction(make_combined_function(pvder_dict))
prob = de.ODEProblem(func, y0, (t0, dt), None)
prob_jit = de.jit(prob) |
@LilithHafner Yes, the method you suggested works. Thanks a lot! However, I am getting another error from within the individual model. What could be the issue?
|
I think you are running into the limitations of Specifically, I'm guessing that python's |
The attribute |
YOu are right. math.exp is the problem. Is there any other option that I can replace it with? |
I'm not sure what there is to be done on your end other than continuing to use the old version of diffeqpy if you depended on numba integration for jit-ing your ODEs. I'll look into fixing it on our end though. |
Ok, I understand. I guess I just have to not use |
First of all, thank you very much for 6770470 and fc32432. I am trying to solve multiple ODEs at once by concatenating them using the below code. The code without
de.jit
works fine.However, if I use de.jit I am getting the following error:
@ChrisRackauckas @LilithHafner could you suggest something that I could try out? For individual ODE, I can get up to 10 times speed up with
de.jit
. However, my application requires solving hundreds of ODE models simultaneously.The text was updated successfully, but these errors were encountered: