function addToResult!(m::SimulationModel{FloatType,TimeType}, x, time, w_invariant...)::Nothing where {FloatType,TimeType}
the result of getDerivatives is called w_invariant and has the type Tuple, which is immutable. So it can be used directly (without deepcopy) in:
test case
instModel.result.n_w_invariant = 149
instModel.nsegments = 1
length(instModel.x_start) = 17
number of result points = 5509
timing
modified
addToResult!
function addToResult!(m::SimulationModel{FloatType,TimeType}, x, time, w_invariant...)::Nothing where {FloatType,TimeType}
the result ofgetDerivatives
is calledw_invariant
and has the typeTuple
, which is immutable. So it can be used directly (withoutdeepcopy
) in:timing with modified
addToResult!
time consumption and storage allocation was reduced dramatically
postscript
in previous
Modia
versions (<=0.8.4
) the same approach was used.used versions
Modia version = "0.9.4-dev" Julia = 1.7.1