Systems Theory and Automatic Control

ADMITaddAdditionalVariable
ADMIT documentation: ADMITaddAdditionalVariable

ADMITaddAdditionalVariable

ADMITaddAdditionalVariable allows to use userdefined additional variables in an
ADMITproject-object.

[OPT,NEW_CON,NEW_AV] = ADMITaddAdditionalVariable(OPT, AVDEF, [OPTIONS])
[OPT,NEW_CON,NEW_AV] = ADMITaddAdditionalVariable(OPT, AVDEF, AVNAME, [OPTIONS])

Adds a new additional variable to the ADMITproject OPT. Input argument
AVNAME is used as the name of the new additional variable. 
If AVNAME is not provided, then a new unique name is generated.
AVDEF defines the new additional variable and it must be of the form:
              avXXX - VARYYY*VARZZZ  (if AVNAME is provided)
           or         VARYYY*VARZZZ  (if AVNAME is not provided)
where both VARYYY and VARZZZ must be existing variables in OPT.
The function automatically determines the time-variance and type (binary,
integer, real) properties of the the new additional variable.

Inputs
  [...]   : square brackets notify that input is optional.
  OPT     : ADMITproject to which new additional variables is added
  AVDEF   : definition of new additional variable
  AVNAME  : name of additional variable

Returns
  OPT     : updated ADMITproject-object with new constraint 
            NEW_CON and NEW_AV included
  NEW_CON : newly generated constraint that defines the new additional
            variable NEW_AV
  NEW_AV  : symbolic expression for the new additional variable with
            correct time-notation e.g. "av1(t)"

Examples

OPT = ADMITproject();
OPT = OPT + ADMITconstraint('x1^3 + x1*x2*x3 == 0')
OPT = OPT + ADMITconstraint('x1 := [0,1]')
OPT = OPT + ADMITconstraint('x2 := [0,1]')
OPT = OPT + ADMITconstraint('x3 := [0,1]')
% To substitute x1*x2 by the additional variable av1:
OPT = ADMITaddAdditionalVariable(OPT,'av1 - x1*x2','av1')
% You than have to run ADMITcompose with mode 'constructQP' to do the
% substitution. This will also introduce another additional variable av2
% such that the system is in quadratic form.
OPT = ADMITcompose(OPT,'CONSTRUCTQP')
% You can also remove av1 and av2 again from the project by using 
% the '-' operator:
OPT = OPT - ADMITvariable('av1') - ADMITvariable('av2')
% which then gives you the original system.