HybridSystem defines a hybrid dynamical system that has both continuous and discrete dynamics, such as bipedal locomotion. More...

Inheritance diagram for HybridSystem:
[legend]

Public Member Functions

 HybridSystem (char name,varargin varargin)
 the default calss constructor More...
 
function obj = setOption (varargin)
 Sets the object options, and return the complete list of option structure including unchanged default options. More...
 
function ret = isdag ()
 returns true if the directed graph is a directed acyclic graph More...
 
function ret = isDirectedCycle ()
 returns true if the underlying directed graph is a simple directed cycle. More...
 
function HybridSystem sys = subGraph (nodeIDs)
 extract the subgraph of the hybrid system to create a new hybrid system object with the same name More...
 
function obj = addVertex (varargin)
 Adds a vertex or a group of vertices to the directed graph 'Gamma'. More...
 
function obj = addEdge (varargin)
 Adds an edge or a group of edges to the directed graph 'Gamma'. More...
 
function obj = rmVertex (cellstr vertex_name)
 Removes a vertex or a group of vertices from the directed graph object 'Gamma'. More...
 
function obj = rmEdge (cellstr s,cellstr t)
 Removes a edge or a group of edges from the directed graph object 'Gamma'. More...
 
function obj = setEdgeProperties (s, t, varargin)
 Sets the values of edge properties. More...
 
function obj = setVertexProperties (cellstr vertex, varargin)
 Sets the values of vertex properties. More...
 
function obj = simulate (double t0,colvec x0,double tf, logger,struct options, varargin)
 Simulate the hybrid dynamical system. More...
 
function obj = compile (char export_path,varargin varargin)
 export the symbolic expressions of the system dynamics matrices and vectors and compile as MEX files. More...
 
function obj = saveExpression (char export_path,varargin varargin)
 save the symbolic expression of system dynamical equations to a MX binary files More...
 

Public Attributes

char Name
 This is the name of the object that gives the object an universal identification. More...
 
digraph Gamma
 The directed graph that describes the hybrid dynamical system structure. More...
 
struct Options
 The option of the hybrid system model. More...
 
struct VertexProperties
 A structure describes the name, type, attributes, and default value of each properties of the vertex. More...
 
struct EdgeProperties
 A structure describes the name, type, attributes, and default value of each properties of the edge. More...
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More...
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More...
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends. More...
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function. More...
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More...
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects. More...
 
 findprop
 Returns a meta.property objects associated with the specified property name. More...
 
 fields
 Returns a cell array of string containing the names of public properties. More...
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More...
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More...
 
 eq
 Relational functions example. See details for more information. More...
 
 transpose
 Transposes the elements of the handle object array. More...
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function. More...
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More...
 
 sort
 ort the handle objects in any array in ascending or descending order. More...
 

Detailed Description

HybridSystem defines a hybrid dynamical system that has both continuous and discrete dynamics, such as bipedal locomotion.

This class provides basic elements and functionalities of a hybrid dynamicsl system. The mathematical definition of the hybrid system is given as

\begin{eqnarray*} \mathscr{HC} = \{\Gamma, \mathcal{D}, U, S, \Delta, FG\} \end{eqnarray*}

The implementation of the hybrid system class is heavily based on the Matlab's digraph data type, with wrapper functions with additional validation.

Author
Ayonga Hereid
Date
2016-09-26

Copyright (c) 2016, AMBER Lab All right reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted only in compliance with the BSD 3-Clause license, see http://www.opensource.org/licenses/bsd-license.php

Constructor & Destructor Documentation

◆ HybridSystem()

HybridSystem.HybridSystem ( char  name,
varargin  varargin 
)
inline

the default calss constructor

Parameters
namethe name of the hybrid system model
vararginvariable parameter input argument

Member Function Documentation

◆ addEdge()

function obj = HybridSystem.addEdge (   varargin)

Adds an edge or a group of edges to the directed graph 'Gamma'.

This function is a wrapper function of Matlab 'addedge' function. It provides extra data type validations for each properties of an edge, besides it supports more flexible way to assign edge properties. The properties will be given as separate input arguments using 'Name-Value' pairs, and missing properties will be inserted with the default value of the corresponding properties.

Note
To add 'Weights' to the edge, specifity 'Weights' properties as other properties. See detailed explanation of the input arguments.
See also
addedge
Note
A struct can be used to replace the (PropName, PropValue) inputs. To be valid input, the structure must have fields with the same name as vertex properties. For mutilple nodes, use the array of structures instead of the structure of arrays. Invalid fields in the structure will be ignored, and missing properties will be added with their default values.
Parameters
vararginvariable types of input arguments.
addEdge ( T, s,t, PropName, PropValue )
Required Parameters for varargin:
  • T a table describes an edge or edges to be added. It must have a variable named 'EndNodes' to be a valid edge. Variables that do not match any of the edge properties will be ignored. Missing edge properties will be added with its default values. Use syntex
    sys =  addVertex(sys, T) 
  • s,t the name pairs of the source vertics and target vertices to be added. They must be a cell string or a character array. Use syntex
    sys =  addVertex(sys, s, t) 
  • PropName a character vector specifiy the name of an edge property for the added edges. It must be given as a 'Name'-'Value' pairs.
  • PropValue the values of the edge properties specified by the 'PropName'. It must be scalar or a cell array with the the same length of the number of the vertices to be added. If it is a scalar, all edges will be assign this scalar value. Use syntex
    sys =  addVertex(sys, s, t, PropName,PropValue,...) 
Generated fields of obj:

◆ addVertex()

function obj = HybridSystem.addVertex (   varargin)

Adds a vertex or a group of vertices to the directed graph 'Gamma'.

This function is a wrapper function of Matlab 'addnode' function. It provides extra data type validations for each properties of a vertex, besides it supports more flexible way to assign properties. The properties will be given as separate input arguments using 'Name-Value' pairs, and missing properties will be inserted with the default value of the corresponding properties.

See also
addnode
Note
A struct can be used to replace the (PropName, PropValue) inputs. To be valid input, the structure must have fields with the same name as vertex properties. For mutilple nodes, use the array of structures instead of the structure of arrays. Invalid fields in the structure will be ignored, and missing properties will be added with their default values.
Parameters
varargin

◆ compile()

function obj = HybridSystem.compile ( char  export_path,
varargin  varargin 
)

export the symbolic expressions of the system dynamics matrices and vectors and compile as MEX files.

Parameters
export_paththe path to export the file
vararginvariable input parameters
compile ( ..., StackVariable, File, ForceExport, BuildMex, Namespace )
Required Parameters for varargin:
  • StackVariable whether to stack variables into one
  • File the (full) file name of exported file
  • ForceExport force the export
  • BuildMex flag whether to MEX the exported file
  • Namespace the namespace of the function

◆ isdag()

function ret = HybridSystem.isdag ( )
inline

returns true if the directed graph is a directed acyclic graph

See also
ISDAG

◆ isDirectedCycle()

function ret = HybridSystem.isDirectedCycle ( )
inline

returns true if the underlying directed graph is a simple directed cycle.

A simple directed cycle is a directed graph that has uniform in-degree 1 and uniform out-degree 1.

◆ rmEdge()

function obj = HybridSystem.rmEdge ( cellstr  s,
cellstr  t 
)

Removes a edge or a group of edges from the directed graph object 'Gamma'.

Note
We only accept char or cellstr type of argument. We do not support scalar, vector, or matrix type of arguments that the 'rmnode' function usually supports. This is for unexpected behaviors to be occured.
See also
digraph, rmnode
Parameters
sthe source vertices
tthe target vertices
Generated fields of obj:

◆ rmVertex()

function obj = HybridSystem.rmVertex ( cellstr  vertex_name)

Removes a vertex or a group of vertices from the directed graph object 'Gamma'.

Note
We only accept char or cellstr type of argument. We do not support scalar, vector, or matrix type of arguments that the 'rmnode' function usually supports. This is for unexpected behaviors to be occured.
See also
digraph, rmnode
Parameters
vertex_namethe vertex name
Generated fields of obj:

◆ saveExpression()

function obj = HybridSystem.saveExpression ( char  export_path,
varargin  varargin 
)

save the symbolic expression of system dynamical equations to a MX binary files

Parameters
export_paththe path to export the file
vararginvariable input parameters
saveExpression ( ..., ForceExport )
Required Parameters for varargin:
  • ForceExport force the export

◆ setEdgeProperties()

function obj = HybridSystem.setEdgeProperties (   s,
  t,
  varargin 
)

Sets the values of edge properties.

◆ setOption()

function obj = HybridSystem.setOption (   varargin)
inline

Sets the object options, and return the complete list of option structure including unchanged default options.

Parameters
vararginname-value pairs of option field value
Return values
optionsthe complete list of final option structure
Generated fields of obj:

◆ setVertexProperties()

function obj = HybridSystem.setVertexProperties ( cellstr  vertex,
  varargin 
)

Sets the values of vertex properties.

Note
A struct can be used to replace the (PropName, PropValue) inputs. To be valid input, the structure must have fields with the same name as vertex properties. For mutilple nodes, use the array of structures instead of the structure of arrays. Invalid fields in the structure will be ignored, and missing properties will be added with their default values.
Parameters
vertexthe names of the vertices to be configured. It must be a cell string or a character array.
varargin

◆ simulate()

function SimLogger logger = HybridSystem.simulate ( double  t0,
colvec  x0,
double  tf,
  logger,
struct  options,
  varargin 
)

Simulate the hybrid dynamical system.

Parameters
t0the starting time
x0the initial condition states
tfthe terminating time
optionsthe ODE options
vararginextra simulation options
Return values
loggeran array of simulation logger data

◆ subGraph()

function HybridSystem sys = HybridSystem.subGraph (   nodeIDs)
inline

extract the subgraph of the hybrid system to create a new hybrid system object with the same name

Parameters
nodeIDsthe node ids of the subgraph
Return values
sysa new HybridSystem object with the subgraph specified by the nodeIDs
Generated fields of sys:

Member Data Documentation

◆ EdgeProperties

HybridSystem.EdgeProperties

A structure describes the name, type, attributes, and default value of each properties of the edge.

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

◆ Gamma

HybridSystem.Gamma

The directed graph that describes the hybrid dynamical system structure.

Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.

◆ Name

HybridSystem.Name

This is the name of the object that gives the object an universal identification.

Default: '

Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.

◆ Options

HybridSystem.Options

The option of the hybrid system model.

Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.

◆ VertexProperties

HybridSystem.VertexProperties

A structure describes the name, type, attributes, and default value of each properties of the vertex.

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

The documentation for this class was generated from the following files:
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/HybridSystem.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/addEdge.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/addVertex.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/compile.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/rmEdge.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/rmVertex.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/saveExpression.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/setEdgeProperties.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/setVertexProperties.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@HybridSystem/simulate.m