Skip to content
LIBRARY
Examples.DoubleIntegratorPlant.md

Examples.DoubleIntegratorPlant ​

Double integrator: a unit mass on a frictionless surface, driven by the force u. The state consists of the position x and the velocity v, both of which are available as outputs. Used by the examples of the MPC introduction and the linear MPC page of the documentation.

Usage ​

MPCComponents.Examples.DoubleIntegratorPlant(m=1.0, x0=0.0, v0=0.0)

Parameters: ​

NameDescriptionUnitsDefault value
mMass–1.0
x0Initial position–0.0
v0Initial velocity–0.0

Connectors ​

  • u - This connector represents a real signal as an input to a component (RealInput)

  • position - This connector represents a real signal as an output from a component (RealOutput)

  • velocity - This connector represents a real signal as an output from a component (RealOutput)

Variables ​

NameDescriptionUnits
xPosition–
vVelocity–

Behavior ​

Behavior of this component cannot be rendered because it includes path variables.

Source ​

dyad
"""
Double integrator: a unit mass on a frictionless surface, driven by the force `u`. The state
consists of the position `x` and the velocity `v`, both of which are available as outputs. Used by
the examples of the MPC introduction and the linear MPC page of the documentation.
"""
component DoubleIntegratorPlant
  "Force"
  u = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -100, "x2": 0, "y1": 450, "y2": 550}}}
  }
  "Position"
  position = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 250, "y2": 350}}}
  }
  "Velocity"
  velocity = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 650, "y2": 750}}}
  }
  "Mass"
  parameter m::Real = 1.0
  "Initial position"
  parameter x0::Real = 0.0
  "Initial velocity"
  parameter v0::Real = 0.0
  "Position"
  variable x::Real(initial = x0)
  "Velocity"
  variable v::Real(initial = v0)
relations
  der(x) = v
  m * der(v) = u
  position = x
  velocity = v
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MPCComponents/DoubleIntegratorExamplePlant.svg"},
    "doc": {"behavior": false}
  }
}
end
Flattened Source
dyad
"""
Double integrator: a unit mass on a frictionless surface, driven by the force `u`. The state
consists of the position `x` and the velocity `v`, both of which are available as outputs. Used by
the examples of the MPC introduction and the linear MPC page of the documentation.
"""
component DoubleIntegratorPlant
  "Force"
  u = RealInput() {
    "Dyad": {"placement": {"diagram": {"x1": -100, "x2": 0, "y1": 450, "y2": 550}}}
  }
  "Position"
  position = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 250, "y2": 350}}}
  }
  "Velocity"
  velocity = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 650, "y2": 750}}}
  }
  "Mass"
  parameter m::Real = 1.0
  "Initial position"
  parameter x0::Real = 0.0
  "Initial velocity"
  parameter v0::Real = 0.0
  "Position"
  variable x::Real(initial = x0)
  "Velocity"
  variable v::Real(initial = v0)
relations
  der(x) = v
  m * der(v) = u
  position = x
  velocity = v
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MPCComponents/DoubleIntegratorExamplePlant.svg"},
    "doc": {"behavior": false}
  }
}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses