VirtualConstraint: represents a group of virtual constraints of a dynamical systems. More...
Public Member Functions | |
VirtualConstraint (DynamicalSystem model, ya,SymExpression name, varargin) | |
The class constructor function. More... | |
function | export (export_path, varargin) |
export the symbolic expressions of the constraints matrices and vectors and compile as MEX files. More... | |
function | configure (load_path, varargin) |
compiles the derivatives and Jacobian of the actual/desired outputs functions More... | |
function varargout = | calcActual (x, dx, offset) |
calculate the actual outputs More... | |
function varargout = | calcDesired (t, x, dx, a, p) |
calculate the desired outputs More... | |
function varargout = | calcPhaseVariable (t, x, dx, p) |
calculate the phase variable More... | |
function nlp = | imposeNLPConstraint (nlp, ep, nzy, load_path) |
impose virtual constraints as NLP constraints in the trajectory optimization problem nlp of the dynamical system More... | |
function | saveExpression (export_path, varargin) |
save the symbolic expressions of the constraints matrices to MX binary files More... | |
function obj = | setOutputLabel (cellstr label) |
OutputLabel sets the naming labels of outputs. More... | |
function obj = | setPhaseType (char type) |
PhaseType sets the type of the phase variable. More... | |
function obj = | setDesiredType (char type,integer degree) |
DesiredType sets the function type of the desired outputs. More... | |
function obj = | setRelativeDegree (integer degree) |
RelativeDegree sets the relative degree of the virtual constraints. More... | |
function obj = | setHolonomic (logical type) |
Holonomic sets the type of whether the virtual constraints are holonomic or nonholonomic. More... | |
function obj = | setPhaseVariable (SymExpression tau,SymVariable p) |
Phase variale sets the symbolic expression of the state-based timing phase variable. More... | |
function name = | validateName (name) |
Name. More... | |
Public Attributes | |
integer | Dimension |
The dimension of the virtual constraints. More... | |
logical | hasOffset = false |
An indicator that shows there is an offset in the actual outputs. More... | |
SymVariable | OutputParams |
The symbolic representation of parameter sets of the desired outputs. More... | |
SymVariable | OffsetParams |
The symbolic representation of offset of the actual outputs: ya = ya_orig + offset_params. More... | |
char | Name |
The name of the virtual constraints. More... | |
SymVariable | PhaseParams |
The symbolic representation of parameters of the phase variable. More... | |
char | OutputLabel |
The label of the virtual constraint. More... | |
char | PhaseType |
The type of the phase variable. More... | |
DesiredType | |
The type of the desired output function. More... | |
integer | RelativeDegree |
The relative degree of the output. More... | |
logical | Holonomic |
Indicates whether the virtual constraint is holonomic or nonholonomic constraints. More... | |
integer | PolyDegree |
The maximum degree of the polynomial function. More... | |
SymFunction | ActualFuncs |
The actual outputs. More... | |
SymFunction | DesiredFuncs |
The desired outputs. More... | |
SymFunction | PhaseFuncs |
The phase variable. More... | |
SymFunction | OutputFuncs |
The virtual constraints ya - yd functions. More... | |
SymExpression | PhaseVariable |
The phase variable. More... | |
SymExpression | ActualOutput |
The actual outputs. More... | |
SymExpression | DesiredOutput |
The desired outputs. More... | |
PhaseParamName | |
The name of the phase parameter variable. More... | |
char | OutputParamName |
The name of the output parameter variable. More... | |
char | OffsetParamName |
The name of the offset parameter variable. 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... | |
Protected Attributes | |
DynamicalSystem | Model |
The dynamical system model. More... | |
SymExpression | ya_ |
The actual outputs. More... | |
SymExpression | yd_ |
The desired outputs. More... | |
SymExpression | tau_ |
The phase variables. More... | |
logical | hasPhaseParam = false |
An indicator that shows there is a parameter variable for phase. More... | |
char | ActualFuncsName_ |
The actual outputs. More... | |
char | DesiredFuncsName_ |
The desired outputs. More... | |
char | PhaseFuncsName_ |
The phase variable. More... | |
char | OutputFuncsName_ |
The virtual constraints ya - yd functions. More... | |
Detailed Description
VirtualConstraint: represents a group of virtual constraints of a dynamical systems.
- Date
- 2017-04-20
Copyright (c) 2016-2017, 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
◆ VirtualConstraint()
|
inline |
The class constructor function.
- Parameters
-
model the dynamical system model in which the virtual constraints are defined ya the symbolic expression of the actual outputs name the name of the virtual constraints varargin optional parameters. In details Required Parameters for varargin:- DesiredType
- PolyDegree
- RelativeDegree
- PhaseType
- Holonomic
- OutputLabel
- Required fields of model:
Member Function Documentation
◆ calcActual()
function colvec ya = VirtualConstraint.calcActual | ( | x, | |
dx, | |||
offset | |||
) |
calculate the actual outputs
- Note
- : the last Jacobian output is the Jacobian of the dNya with respoect to the states, which is [x] for a first order system and [x;dx] for a second order system.
- Parameters
-
x the states dx the first order derivatives
- Return values
-
ya variable outputs in the following order: the actual output value d1ya the first order derivative ... dNya the N = RelativeDegree - 1 order derivative JdNya the Jacobian of dNya w.r.t. to the states
◆ calcDesired()
function colvec yd = VirtualConstraint.calcDesired | ( | t, | |
x, | |||
dx, | |||
a, | |||
p | |||
) |
calculate the desired outputs
- Note
- : the last Jacobian output is the Jacobian of the dNyd with respoect to the states, which is [x] for a first order system and [x;dx] for a second order system.
- Parameters
-
t the time x the states dx the first order derivatives a the parameters of the desired output p the parameters of the phase variable
- Return values
-
yd variable outputs in the following order: the actual output value d1yd the first order derivative ... dNyd the N = RelativeDegree - 1 order derivative JdNyd the Jacobian of dNya w.r.t. to the states
◆ calcPhaseVariable()
function double tau = VirtualConstraint.calcPhaseVariable | ( | t, | |
x, | |||
dx, | |||
p | |||
) |
calculate the phase variable
- Note
- : the last Jacobian output is the Jacobian of the dNya with respoect to the states, which is [x] for a first order system and [x;dx] for a second order system.
- Parameters
-
t the time x the states dx the first order derivatives p the parameter set
- Return values
-
tau variable outputs in the following order: the phase variable value d1tau the first order derivative ... dNtau the N = RelativeDegree - 1 order derivative JdNtau the Jacobian of dNya w.r.t. to the states
◆ configure()
function obj = VirtualConstraint.configure | ( | load_path, | |
varargin | |||
) |
compiles the derivatives and Jacobian of the actual/desired outputs functions
- Generated fields of obj:
◆ export()
function VirtualConstraint.export | ( | export_path, | |
varargin | |||
) |
export the symbolic expressions of the constraints matrices and vectors and compile as MEX files.
- Parameters
-
export_path the path to export the file varargin variable input parameters Required Parameters for varargin:export ( ..., Vars, File, ForceExport, BuildMex, Namespace )- Vars a list of symbolic variables
- 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
◆ imposeNLPConstraint()
function TrajectoryOptimization nlp = VirtualConstraint.imposeNLPConstraint | ( | nlp, | |
ep, | |||
nzy, | |||
load_path | |||
) |
impose virtual constraints as NLP constraints in the trajectory optimization problem nlp
of the dynamical system
For each (vector) virtual constraints, we will enforce the following
- constraints at the first node
- {y, y', ..., y^N} % where N = RelativeDegree - 1
- and this constraint
- y^(N+1) + ep_N y^N + ... ep_1 y = 0 at all nodes.
- Note
- For example, ep = [kp, kd] for typical vector relative degree 2 holonomic virtual constraints.
- For example, nzy = [0] for a relative degree 1 nonholonomic virtual constraint (velocity outputs) means we do not require y to be zero at the first node. Another example, nzy = [0,0] for a relative degree 2 virtual constraints, we do not require both y and y' to be zero at the first node, on the other hand, nzy = [1,0] for a relative degree 2 virtual constraints, we only enforce y being zero at the first node.
- Parameters
-
nlp the trajectory optimization NLP ep the coefficients of the derivatives nzy the derivatives that does not requires to be zero at the first node
- Required fields of nlp:
◆ saveExpression()
function VirtualConstraint.saveExpression | ( | export_path, | |
varargin | |||
) |
save the symbolic expressions of the constraints matrices to MX binary files
- Parameters
-
export_path the path to export the file varargin variable input parameters Required Parameters for varargin:saveExpression ( ..., ForceExport )- ForceExport force the export
◆ setDesiredType()
DesiredType sets the function type of the desired outputs.
- Parameters
-
type the function type degree the degree of polynomials
- Generated fields of obj:
◆ setHolonomic()
|
inline |
Holonomic sets the type of whether the virtual constraints are holonomic or nonholonomic.
- Parameters
-
type true for holonomic, false for nonholonomic
- Generated fields of obj:
◆ setOutputLabel()
|
inline |
OutputLabel sets the naming labels of outputs.
- Parameters
-
label the cell array of labels
- Generated fields of obj:
◆ setPhaseType()
|
inline |
PhaseType sets the type of the phase variable.
- Parameters
-
type type of the phase variable
- Generated fields of obj:
◆ setPhaseVariable()
|
inline |
Phase variale sets the symbolic expression of the state-based timing phase variable.
- Parameters
-
tau the phase variable p the parameters of tau
- Generated fields of obj:
◆ setRelativeDegree()
|
inline |
RelativeDegree sets the relative degree of the virtual constraints.
- Parameters
-
degree relative degree of outputs
- Generated fields of obj:
◆ validateName()
|
inline |
Name.
Member Data Documentation
◆ ActualFuncs
VirtualConstraint.ActualFuncs |
The actual outputs.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ ActualFuncsName_
|
protected |
The actual outputs.
◆ ActualOutput
VirtualConstraint.ActualOutput |
The actual outputs.
- Note
- This property has the MATLAB attribute
Dependent
set to true. - Matlab documentation of property attributes.
- [readonly]
◆ DesiredFuncs
VirtualConstraint.DesiredFuncs |
The desired outputs.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ DesiredFuncsName_
|
protected |
The desired outputs.
◆ DesiredOutput
VirtualConstraint.DesiredOutput |
The desired outputs.
- Note
- This property has the MATLAB attribute
Dependent
set to true. - Matlab documentation of property attributes.
- [readonly]
◆ DesiredType
VirtualConstraint.DesiredType |
The type of the desired output function.
- It could be one of the following functions
- {
Bezier
,CWF
,ECWF
,MinJerk
,Constant
}
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ Dimension
VirtualConstraint.Dimension |
The dimension of the virtual constraints.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ hasOffset
VirtualConstraint.hasOffset = false |
An indicator that shows there is an offset in the actual outputs.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
-
Matlab documentation of property attributes.
Default: false
◆ hasPhaseParam
|
protected |
An indicator that shows there is a parameter variable for phase.
Default: false
◆ Holonomic
VirtualConstraint.Holonomic |
Indicates whether the virtual constraint is holonomic or nonholonomic constraints.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ Model
|
protected |
The dynamical system model.
◆ Name
VirtualConstraint.Name |
The name of the virtual constraints.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ OffsetParamName
VirtualConstraint.OffsetParamName |
The name of the offset parameter variable.
- Note
- This property has the MATLAB attribute
Dependent
set to true. - Matlab documentation of property attributes.
- [readonly]
◆ OffsetParams
VirtualConstraint.OffsetParams |
The symbolic representation of offset of the actual outputs: ya = ya_orig + offset_params.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ OutputFuncs
VirtualConstraint.OutputFuncs |
The virtual constraints ya - yd functions.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ OutputFuncsName_
|
protected |
The virtual constraints ya - yd functions.
◆ OutputLabel
VirtualConstraint.OutputLabel |
The label of the virtual constraint.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ OutputParamName
VirtualConstraint.OutputParamName |
The name of the output parameter variable.
- Note
- This property has the MATLAB attribute
Dependent
set to true. - Matlab documentation of property attributes.
- [readonly]
◆ OutputParams
VirtualConstraint.OutputParams |
The symbolic representation of parameter sets of the desired outputs.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ PhaseFuncs
VirtualConstraint.PhaseFuncs |
The phase variable.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ PhaseFuncsName_
|
protected |
The phase variable.
◆ PhaseParamName
VirtualConstraint.PhaseParamName |
The name of the phase parameter variable.
- Note
- This property has the MATLAB attribute
Dependent
set to true. - Matlab documentation of property attributes.
- [readonly]
◆ PhaseParams
VirtualConstraint.PhaseParams |
The symbolic representation of parameters of the phase variable.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ PhaseType
VirtualConstraint.PhaseType |
The type of the phase variable.
It could be either StateBased
or TimeBased
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ PhaseVariable
VirtualConstraint.PhaseVariable |
The phase variable.
- Note
- This property has the MATLAB attribute
Dependent
set to true. - Matlab documentation of property attributes.
- [readonly]
◆ PolyDegree
VirtualConstraint.PolyDegree |
The maximum degree of the polynomial function.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ RelativeDegree
VirtualConstraint.RelativeDegree |
The relative degree of the output.
- Note
- This property has non-standard access specifiers:
SetAccess = Protected, GetAccess = Public
- Matlab documentation of property attributes.
◆ tau_
|
protected |
The phase variables.
◆ ya_
|
protected |
The actual outputs.
◆ yd_
|
protected |
The desired outputs.
The documentation for this class was generated from the following files:
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/VirtualConstraint.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/calcActual.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/calcDesired.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/calcPhaseVariable.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/configure.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/export.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/imposeNLPConstraint.m
- /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/system/@VirtualConstraint/saveExpression.m