I created a basic model of a hot water storage cylinder in Dymola using components from the buildings library package. I have saved the model as an .mo file and successfully compiled the fmu and loaded the model in JModelica. The problem occurs when I simulate using:
res = model.simulate(final_time=100000)
This results in the following error message:
FMUException Traceback (most recent call last) in () ----> 1 res = model.simulate(final_time=100000)
src\pyfmi\fmi.pyx in pyfmi.fmi.FMUModelME1.simulate (src\pyfmi\fmi.c:35608)()
src\pyfmi\fmi.pyx in pyfmi.fmi.ModelBase._exec_simulate_algorithm (src\pyfmi\fmi.c:6045)()
src\pyfmi\fmi.pyx in pyfmi.fmi.ModelBase._exec_simulate_algorithm (src\pyfmi\fmi.c:5936)()
C:\JModelica.org-2.1\install\Python\pyfmi\fmi_algorithm_drivers.pyc in init(self, start_time, final_time, input, model, options) 300 if isinstance(self.model, fmi.FMUModelME1): 301 self.model.time = start_time #Set start time before initialization --> 302 self.model.initialize(tolerance=rtol) 303 304 elif isinstance(self.model, fmi.FMUModelME2) or isinstance(self.model, fmi_coupled.CoupledFMUModelME2):
src\pyfmi\fmi.pyx in pyfmi.fmi.FMUModelME1.initialize (src\pyfmi\fmi.c:34954)()
FMUException: Initialize returned with an error. Check the log for information (FMUModel.get_log).
As suggested I have checked the log using model.get_log()
which also does not make much sense:
FMIL: module = Model, log level = 2: [ERROR][FMU status:Error] Could not bracket the root in "1". Both lower and upper are at bounds.
FMIL: module = Model, log level = 2: [INFO][FMU status:Error] Initialization failed.
FMIL: module = Model, log level = 2: [ERROR][FMU status:Error] Could not bracket the root in name="block">"1". Both lower and upper are at bounds.
FMIL: module = Model, log level = 2: [INFO][FMU status:Error] Initialization failed.
FMIL: module = Model, log level = 2: [ERROR][FMU status:Error] category="error">Could not bracket the root in name="block">"1". Both lower and upper are at> bounds.
FMIL: module = Model, log level = 2: [INFO][FMU status:Error] Initialization failed.
FMIL: module = Model, log level = 2: [ERROR][FMU status:Error] category="error">Could not bracket the root in name="block">"1". Both lower and upper are at> bounds.
FMIL: module = Model, log level = 2: [INFO][FMU status:Error] Initialization failed.
Any recommendations on what is going on here? I've heard many people constructing systems with Dymola, saving the script and then importing and simulating in JModelica. However could this be the problem here?