- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Model Exchange FMU fails to Enter...
Model Exchange FMU fails to Enter Event Mode
Model Exchange FMU fails to Enter Event Mode
I could not find anything related to this exception. Can someone help me ?
Code:
from pyfmi import load_fmu
import matplotlib.pyplot as plt
import numpy as N
# Simulation parameters:
dt = 0.0001
tf = 15
ts = 0
model="AIMC_Inverter.fmu"
generate_plot = False
# Load model
mod = load_fmu(model, log_level=4) # default setting is 2
mod.set_max_log_size(2073741824) # = 2*1024^3 (about 2GB)
# Get Continuous States and nominal values
x = mod.continuous_states
x_nominal = mod.nominal_continuous_states
mod.setup_experiment(start_time = ts) # Set the start time to ts
mod.initialize()
eInfo = mod.get_event_info()
eInfo.newDiscreteStatesNeeded = True
#Event iteration
while eInfo.newDiscreteStatesNeeded == True:
mod.enter_event_mode()
mod.event_update()
eInfo = mod.get_event_info()
mod.enter_continuous_time_mode()
Error:
File "src/pyfmi/fmi.pyx", line 7512, in pyfmi.fmi.FMUModelME2.enter_event_mode
pyfmi.fmi.FMUException: Failed to enter event mode.
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Model Exchange FMU fails to Enter...