Hybridní systémy
B3M35HYS + BE3M35HYS
Tento kurz je součástí již archivovaného semestru, a proto je dostupný pouze pro čtení.
Exercises
Požadavky na absolvování
- Modelling thermostat using
- Simulink (and its Multiport switch and Relay blocks)
- Stateflow
- Emphasize the steps necessary for continuous modelling in Stateflow
- Choose Variable-step solver in Solver settings.
- Set Continuous update for the whole chart.
- Set Continuous update for the state variable (temperature here).
- Modelling a bouncing ball using
- Matlab
- The crucial functionality here is that of event localization by ODE solvers.
- Simulink
- Note that using the integrator output directly for creating a resetting signal for another integrator can introduce an algebraic loop. It is possible to display and use the state port directly.
- Stateflow
- Switching DC-DC boost converter
- Obviously the switch introduces two modes, but the (ideal) diode introduces another pair. Their intersection gives three modes:
OFF,CCM(continuous conduction mode),DCM(discontinuous conduction mode). - Control of a reactor with two rods [OPEN-ENDED]
- This example is from Alur, Rajeev. Principles of Cyber-Physical Systems. Cambridge, MA, USA: MIT Press, 2015. https://mitpress.mit.edu/9780262029117/principles-of-cyber-physical-systems/.
- We consider thermal behaviour of a nuclear reactor. If the temperature is above some threshhold, there are two rods that can be inserted (either one or the other, not both) to reduce the temperature.
- Thermal dynamics of the reactor is modelled as as a hybrid automaton with three discrete states (modes, locations), depending on whether a rod is inserted on not, and if yes, then which of the two rods.

- The controller is described using the following hybrid automaton

- Obviously the controller knows the temperature x of the reactor. It has only two continuous variables y1 and y2, which correspond to time. These time(rs) are needed to check if sufficient time has passed since the last removal of the rod from the reactor.
- Note that the second rod is the first choice since its temperature dampening effect is stronger.
- When implementing the model of the whole systems in Stateflow, it is certainly wise to keep the model of the reactor and the model of the controller separate. One reason might be that later we may be requested to generate a code for the controller.
- The challenge now is how to let the two subsystems communicate/synchronize. An important restriction imposed on Stateflow charts containing continuous-time dynamics is that [input events are not allowed in Stateflow in the continuous mode. A solution attempted in the diagram below then does not work

- Can you come up with a solution?
- Apparently the events encoded by a signal (as its edge) are acceptable, see the example Yo-Yo Control of Satellites. The two subsystems (the reactor and the controller) may have to be implemented as two separate charts in a Simulink diagram, communicating through signals.
- This example is from
Naposledy změněno: pondělí, 23. října 2023, 15.34