Software

A Hybrid Systems Simulation Toolbox for Matlab/Simulink (HyEQ)

download link


Description:

 A hybrid system is a dynamical system with continuous and discrete dynamics. Several mathematical models for hybrid systems have appeared in literature. In these files, we consider the framework for hybrid systems used in [3,4], where a hybrid system is defined by a set C called the flow set, a function f called the flow map, a set D called the jump set, a function called the jump map, and a set O called the state space. This can be written mathematically as


To simulate such systems, we have developed the Hybrid Equations Toolbox (HyEQ). The toolbox includes the Matlab function hyEQsolver.m, which can be called from the workspace like any other ode function. We refer to this function as the Lite Simulator.  It also includes a toolbox entry for Simulink. The  Simulink implementation in HyEQ includes five basic blocks that define the dynamics of a hybrid system. These include the flow map, flow set, jump map, jump set, and state space. The flows and jumps of the system are computed by the integrator system which is comprised of blocks that compute the continuous dynamics of the hybrid system, trigger jumps, update the state of the system and simulation time at jumps, and stop the simulation. Files are included that plot the solutions of simulations including the corresponding hybrid arcs. See the documentation file for more details and examples of already simulated hybrid systems.

Capabilities:

The current version includes examples of individual and interconnected hybrid systems where multiple hybrid systems are connected and interact. Also included is a lite simulator, which allows for faster simulation of an individual hybrid system.

 
 
 
 

 

Online Webinar at Mathworks website:

Link to HyEQ Toolbox Webinar: http://www.mathworks.com/videos/hyeq-a-toolbox-for-simulation-of-hybrid-dynamical-systems-81992.html

 

Requirements:

MATLAB R2010a or newer, Simulink, C-compiler

 

Download:

Matlab/Simulink Code and Instructions available at Matlab Central.

New beta version:

https://www.mathworks.com/matlabcentral/fileexchange/102239-hybrid-equations-toolbox-beta

Current stable version (v2.04):

http://www.mathworks.com/matlabcentral/fileexchange/41372-hybrid-equations-toolbox-v2-04

 

Other Resources:

1) The Hybrid Simulator blog

https://hybridsimulator.wordpress.com

 

2) SummerSim 2014 paper on symbolic hybrid simulator: The files associated to the examples in our SummerSim 2014 paper are available here

SummerSim14Examples.zip

 

3) HSCC paper 74 on hybrid simulator: The files associated to the examples in our HSCC 2013 paper (see 74) are available here

HSCC13Examples.zip

HSCC13NewExample.zip

 

Previous versions not posted at Matlab Central:

HyEQ_Toolbox_v1.zip

HybridSimulator_v06.zip

HybridSimulator_v05.zip

HybridSimulator_v04.zip

HybridSimulator_v03.zip

 

Changelog:

05/17/17: version 2.04. Hybrid Equations Simulator. 

A new version of the simulator is available! The main new features are: 

1) Compatibility issues with matlab 2014-2016 are now solved. 
2) Instructions file updated. 
3) New examples and html files. 
4) Now is possible to solve DAE equations as a flow maps. 

 

04/10/16: version 2.03. Hybrid Equations Simulator. 

The main new features of this new version are:

1) New zero events code in the lite HyEQ simulator 
2) Instructions file updated 
3) New help html files 
4) Smaller installation file 
5) Cyber Physical Systems CPS blocks in the simulink library (interconnected systems) 
6) CPS examples 
7) Problems in installation for 2014b are now solved 
8) Now is possible to select which ode solver the lite HyEQsolver is going to use 
9) New plot functions for pre and post 2014b plot behaviour

 

04/29/14: version 2.01. Hybrid Equations Simulator.

The main changes from 2.0 to 2.01 are: 
1) Added two new plotting functions plotHarcColor and plotHarcColor3D 
2) All functions have now the standard head (H1) help line (which is required to search functions such as "lookfor", e.g., >> lookfor HyEQ, or >> lookfor hybrid) 
3) Functions plotC and plotD were removed (none of examples uses those functions) 
4) New help environment for all functions were created (with examples inclued), e.g., 
>> help HyEQ_Toolbox_V201 
>> help HyEQsolver 
>> help plotflows 
>> help plotHarc 
>> help plotHarcColor 
>> help plotHarcColor3D 
>> help plotHybridArc 
>> help plotjumps 
>> helpwin HyEQ_Toolbox_V2_01 
5) Some of the postprocessig files in the examples (simulink) were edited to include the new plotting functions.

 

04/18/12: version 2.0. Hybrid Equations Simulator.

Additions from previous version:

1) Elimination of the maxStepCoefficient variable for the lite simulator.
2) Fixed bugs in HyEQsolver.m.
3) New simulink library for hybrid systems with and without inputs.
4) Three hybrid system blocks are defined in the library: i) A hybrid system without input and without embedded C code blocks, ii) A hybrid system without inputs and with embedded C code blocks (for fast computation time), and iii) A hybrid system with inputs and with embedded C code blocks.
5) Examples added in the Simulink library and help files for each case.
6) New install file that copies the required files, such as plot scripts and simulation scripts, to Matlab's path.
7) New function (plotHarc) for plotting and segmentation of hybrid arcs.
8) The "u(3) block" inside the Integrator system has been removed.
9) Initialization and plot buttons have been changed to allow the users to select initialization and postprocessing scripts.

 

01/10/12: version 1.0. Hybrid Equations Simulator. Additions from previous version:

1) deleted global variables, now set as inputs/parameters 2) added "u" as an input into each embedded function 3) jump logic and update logic implemented using only Simulink blocks 4) masked integrator system 5) added option of not saving flowSet and jumpSet variables 6) removed "O" globally

 

08/09/11: version 0.6. Additions from previous version:

1) Deleted 'sim' command in initialization.m. 2) Variables for solver tolerances in initialization.m. 3) Changed u- to u.

 

02/16/11: version 0.5. Additions from previous version:

1) Embedded functions. 2) Initialization and postprocessing double-click blocks. (initialization.m and postprocessing.m)(Got rid of run.m) 3) Changed ' notation to - (e.g. x' is now x-). 4) Lite simulator

 

12/31/10: version 0.4. Additions from previous version:

1) Interconnection example.

 

04/21/08: version 0.3. Additions from previous version:

1) Blocks renamed.

 

10/22/07: version 0.2. Additions from previous version:

1) Global variables.

 

05/25/07: version 0.1. Additions from previous version:

1) Stop Logic. 2) Rules for priority of flows and jumps.

 

References:

[74] Sanfelice, R. G., Copp, D., Nanez, P. A Toolbox for Simulation of Hybrid Systems in Matlab/Simulink: Hybrid Equations (HyEQ) Toolbox In Proceedings of Hybrid Systems: Computation and Control Conference, 2013.

[2] http://control.ee.ethz.ch/~ifaatic/ex/example1.m. Institut für Automatik - Automatic Control Laboratory, ETH Zurich, 2011.

[3] R. Goebel, R. G. Sanfelice, and A. R. Teel, Hybrid dynamical systems. IEEE Control Systems Magazine, 28-93, 2009.

[4] R. G. Sanfelice and A. R. Teel, Dynamical Properties of Hybrid Systems Simulators. Automatica, 46, No. 2, 239--248, 2010.

[5] Ricardo G. Sanfelice, Interconnections of Hybrid Systems: Some Challenges and Recent Results. 2011.

 

Research supported by NSF, ARO, AFOSR, Mathworks, and Honeywell.

Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.