Open rvignolo opened 5 years ago
I am over the phone now, but
IDASolve
source code here and it seems that the value of this parameter is not used.ida_step_dt
is INFTY
so the first condition is never satisfied. However, if a min_dt
has been provided and the time equals to zero, we step in. Time equals to zero means first time, right? In this case, wasora can solve a system of DAEs only if the the starting time is zero, right? Should we use wasora_value(wasora_special_var(in_transient_first)) == 1
instead so we can remove the limitation of a starting time equal to zero?
If this condition is true, either because we are in the first transient step with a min_dt
or because the last computed ida_step_dt
is smaller than a min_dt
, we perform the loop of single steps that you commented out using a stopping time t + min_dt
.
When time moves forward, we will keep stepping in if the last computed ida_step_dt
is smaller than the min_dt
. However, it might happen that IDASolve
reaches the stopping time in only one step, meaning that ida_step_dt = min_dt
. In this case, the next transient step would not step into this block, but it will go to the next one:
https://github.com/seamplex/wasora/blob/d80ca8aa0ae3612c801592d44d80b5c85c9c54f2/src/wasora.c#L315-L326
In this block, there is no stopping time being set using min_dt
(there is only one using TIME_PATH
keyword), so IDA may advance in time further than wanted, i.e. further than t + min_dt
.Am i missing something?
oh I just realized that there is no problem if we go further than t + min_dt
, the problem would be if we go further than t + max_dt
! That will not happen because:
https://github.com/seamplex/wasora/blob/d80ca8aa0ae3612c801592d44d80b5c85c9c54f2/src/wasora.c#L284-L287
The problem would be the opposite, if we advance less than wanted, i.e. we do not reach t + min_dt
. Any thoughts?
I am seeinng https://seamplex.com/wasora/doc/realbook/004-exp/ which you can find in the doc/realbook repo and everything works as expected in the exp-dt.was
case
Are these lines:
https://github.com/seamplex/wasora/blob/d80ca8aa0ae3612c801592d44d80b5c85c9c54f2/src/wasora.c#L303-L304
correct?
I see the following issues:
ida_step_t_new
being set? It is going to be replaced when callingIDASolve
.IDASolve
should bewasora_var(wasora_special_var(time)) + wasora_var(wasora_special_var(min_dt))
, notwasora_var(wasora_special_var(dt))
. The User Documentation for IDA says that this argument corresponds to the next time at which a computed solution is desired. However, if theIDA_ONE_STEP
mode is set (as in this case), this variable is used on the first call only, and only to get the direction and rough scale of the independent variable. I still believe it should be set as recommended.Thanks and regards, Ramiro.