CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

record

Control.Mpc.OcpSpec

Fixed-horizon quadratic tracking optimal control problem

The tracking weight diagonals belong to this problem description as well, but the compiler currently rejects record components whose dimensions depend on sibling record members, so the weights live as parameters of PartialTranscription, sized there by stateCount and inputCount. Fold them back into this record once dependent record dimensions are supported.

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
fieldstateCountInteger(min=1) = 2Plant state dimension nx
fieldinputCountInteger(min=1) = 1Control input dimension nu
fieldhorizonLengthInteger(min=1) = 10Number of shooting intervals N
fieldsamplePeriodReal(unit="s", min=1.0e-9) = 0.05Control tick and shooting-interval length
fieldregularizationReal(min=0.0) = 1.0e-9Diagonal damping the step solver may add to its normal matrix

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

record OcpSpec "Fixed-horizon quadratic tracking optimal control problem"
  Integer stateCount(min=1) = 2 "Plant state dimension nx";
  Integer inputCount(min=1) = 1 "Control input dimension nu";
  Integer horizonLength(min=1) = 10 "Number of shooting intervals N";
  Real samplePeriod(unit="s", min=1.0e-9) = 0.05
    "Control tick and shooting-interval length";
  Real regularization(min=0.0) = 1.0e-9
    "Diagonal damping the step solver may add to its normal matrix";
  annotation(Documentation(info="<html>
    <p>The tracking weight diagonals belong to this problem description as
    well, but the compiler currently rejects record components whose
    dimensions depend on sibling record members, so the weights live as
    parameters of <code>PartialTranscription</code>, sized there by
    <code>stateCount</code> and <code>inputCount</code>. Fold them back into
    this record once dependent record dimensions are supported.</p>
  </html>"));
end OcpSpec;