I'm trying to use the importInitialResult command to set initial values from old results. After doing this, I press the simulate button and receive the following error:
The boundary mass fractions in medium "AirNOW" in model "FixedBoundary"
do not sum up to 1. Instead, sum(X_boundary) = 1:
X_boundary[1] = 0.005 "H2O"
X_boundary[2] = 0.23 "O2"
X_boundary[3] = 0.765 "N2"
it does not make sensse since 0.005 + 0.23 + 0.765 equal 1. I cound not figure out why i get this eror and how to make it correct.
It is difficult to fully answer this without the full model, but the error message and using
importInitialResultsuggests one explanation:It should be possible to avoid this by any of the following:
AirNOW-modelX_boundarybut instead compute it as1-sum(X_boundary[1:..])Added:
Without the example model I tried importInitialResult for Modelica.Fluid.Examples.TraceSubstances.RoomCO2:
traceVolume.CVec[traceVolume.ind]- that is somewhat specific for this example; but in general protected variables can be a problem.Note that those changes must be done before the first simulation, so that importInitialResult reads from such a result file. The GUI for importInitialResult will show warnings if the result file doesn't contain all variables in double precision.