incorporates both time-based and event-based modeling. It models tanks
queuing up to be filled.
seExampleTankFilling example has two
sections, a SimEvents® part that models event-based behavior and
a Simulink® part that models continuous-time dynamics.
The SimEvents part models the flow of tanks.
The Entity Generator block generates the tanks.
The Entity Queue block queues each tank in FIFO mode.
The Entity Server block calls the
startFilling Simulink function
to fill each tank.
The Simulink part models the time-driven process of filling tanks.
The Simulink side of the model contains the logic to fill the tanks.
Each tank has a
The continuous time part models the process of filling up a tank,
modeled by the Integrator block. When a tank is filled
to capacity, the Entity Gate block releases the tank
and it departs.
The Simulink side of the model also contains
the Simulink function
The Flip Completion Logic subsystem completes the filling of the tank and reinitializes for the next fill. It uses the Entity Gate block to release each tank.
In the first scope, observe the fill process.
In the second scope, observe the number of trucks leaving after being filled.
seExampleTankFilling model, the time-based
dynamics of the tank fill coexist with the event-based dynamics of
the tank flow subsystem. When you run the simulation, the solver and
the event calendar both play a role. Upon major time steps of the
solver, the simulation solves the ordinary differential equations
that represent the dynamics of the tank fill system. Solving the event-based
dynamics entails scheduling and processing events, such as service
completion and entity generation, on the SimEvents event
calendar. Because the model uses a variable-step solver, when events
occur in the discrete-event system, the solver has a major time step.