Closed CRquantum closed 2 years ago
I dont think you need to call the Init function again if a parameter is changed. Just change the parameter using the DiffEqSys object you have and call integrate again.
so you can do something like this:
testSysObj%AAA = <new_value>
call erkvar%Integrate(x0_test, y0_test, xf_test, yf_test, StepSz=stepsz, UseConstStepSz=CONST_STEPSZ, &
IntStepsOn=.TRUE.,Xint = Xint, Yint = Yint, &
EventStates=EventStates, EventMask = EvMask,StiffTest=stiffstatus)
Great thank you!
Hi @princemahajan ,
I am using your nice code and I continue to understand more of your nice code! I just have a question, not an issue.
I need to solve basically the same ODEs many many times, say 10^5 times. The ODE can be, for simplicity,
So I can define this YP(1) = AAA*Y(1) as F in an Object say, testSysObj, which is of the type of extends(DiffEqSys).
Now, it is just that, the parameter AAA is changed each time. So you can say I actually solve 10^5 times different ODEs. But actually the ODE are basically the same, just the parameter AAA changed.
So my question is, each time AAA changes, so do I have to do init first, then integrate it? If so, will that init each time, slow down the code?
Currently I know it will be like below,
Do you think it is possible to directly put the object testSysObj in the argument, and do integration like below
and it may speedup the code a little bit? Or, is it that the init stage actually is very cheap it does not really matter?
Thank you very much!
Best regards, Rong