Opened 4 years ago
Last modified 2 years ago
#6097 new enhancement
Store imported start values for later reuse — at Initial Version
Reported by: | Francesco Casella | Owned by: | Karim Adbdelhak |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Interactive Environment | Version: | |
Keywords: | Cc: | daniel.bouskela@…, Adeel Asghar |
Description
ticket:5024#comment:3 discusses how to import start values from previous simulations (possibly carried out with other tools) to help the initialization of models. This requires cumbersome data files, while only a minimal part of that information is actually used.
@daniel.bouskela asks if it is possible to store this information for later reuse.
One option could be to introduce a vendor annotation where OpenModelica stores all the start values that are actually needed to initialize the nonlinear solvers during initialization, and only them.
For example, we could introduce an API function call storeExternalInitValues(model, "results.mat");
that carries out the following steps:
- compiles
model
- determines what are the variables for which initial guesses are required during initialization to set up the iterative solvers
- loads their value from the result file
- adds (or replaces, if it already exists) an annotation such as
__OpenModelica_storedInitValues( M1.M2.v1 = <value>; M1.M2.v2 = <value>; ...);
Then we could add a simulation flag -iis
that has the same effect as -iif
, but gets the data from the stored values instead of getting them from the result file.
@Karim, @AnHeuermann, what do you think?