admin管理员组

文章数量:1124763

I have made a model in OpenModelica v1.21.0 using Buildings library v10.0.0. I simulate this model in Python using OMPython. Here is what I try to do:

  1. simulate the model for Day1 using:
mod.setSimulationOptions(["startTime=0, stopTime=86400, stepSize=300, tolerance=1e-06, solver=dassl"])
simflags = "-lv=-stdout,-LOG_SUCCESS"
mod.simulate(resultfile = RESULT_FILEPATH + "day1.mat", simflags = simflag)
  1. change the value of some parameters in the model:
mod.setParameters("[heatSetpoint[2, 2] = 21") # heatSetpoint is parameter Real heatSetpoint[169, 2], and I change all the items in heatSetpoint
  1. simulate the model for Day2 giving the output file of Day1 for the initialization:
mod.setSimulationOptions(["startTime=86400, stopTime=172800, stepSize=300, tolerance=1e-06, solver=dassl"])
simflag = f"-iim=none -iif={RESULT_FILEPATH}day1.mat -iit=86400 -lv=-stdout,-LOG_SUCCESS"
mod.simulate(resultfile = RESULT_FILEPATH + "day2.mat", simflags = simflag)

This works when I use OpenModelica v1.21.0 and Buildings library v10.0.0.

Now I want to update the model to use the latest versions of OpenModelica (1.24.3) and Buildings Library (11.0.0).

After the update, the first step (simulating for Day1) works; however, when I try to run simulation for Day2 I get the following error:

LOG_ASSERT        | error   | [C:/Users/xxxxx/AppData/Roaming/.openmodelica/libraries/Buildings 11.0.0/BoundaryConditions/WeatherData/BaseClasses/ConvertTime.mo:22:3-26:26:writable]
|                 | |       | The following assertion has been violated during initialization at time 86400.000000
|                 | |       | ((weaDat.conTim.canRepeatWeatherFile or noEvent(time - weaDat.conTim.weaDatEndTim < 1800.0))) --> "In modelTwo.weaDat.conTim: Insufficient weather data provided for the desired simulation period.
|                 | |       |     The simulation time 86400 exceeds the end time 0 of the weather data file."

I should also mention that to simulate the model for Day2 with the latest version of OpenModelica, I changed -lv=-stdout in simflag to -lv=-LOG_STDOUT.

Moreover, I only get this error when I try to use a .mat file to initialize the simulation, otherwise I can run the model for a whole year without this error.

I tried using Buildings Library v11.0.0 with OpenModelica v1.21.0, and I did not get this error. So, it seems to be related to OpenModelica v1.24.3.

I would appreciate it if anyone can help me solve this issue.

本文标签: