I use Dymola’s simulateMultiResultsModel
function to simulate multiple sets of parameters as part of a parameter estimation process (in Python). However, it appears that if simulation of one parameter set fails, all simulations fail, and I can’t receive the results for all other parameter sets. Is it possible to get the results of the non-failing parameter sets?
That requires adding the special variable "terminal"
as output.
Consider:
model U
parameter Real p=1;
Real x;
equation
assert(p>0, "Required");
der(x)=1-p*x;
end U;
To simulate and get results use:
simulateMultiResultsModel("U",initialNames={"p"},initialValues=[1;2;-1;3],numberOfIntervals=2,resultNames={"x","terminal"})
The failing results have 0 as result for terminal
(after the simulation failed).
This is documented in the Dymola User’s Manual under simulateMultiExtendedModel
(page 970 for Dymola 2023x Refresh 1; page 1002 for Dymola 2025x).
2