Links
🚴♂

Continuous Blocks

The following blocks are defined as having a continuous time_mode
More about time_modes.

Battery Cell

Implements a dynamic electro-chemical cell as presented in Experimental Validation of a Battery Dynamic Model for EV Applications. Note, this block only implements the Li-ion model presented, not the Lead-Acid nor the NiMH/NiCd models.
By using appropriate parameters, the cell model can be used to model a battery pack with the assumption that the cells of the pack behave as a single unit.
Parameters E0, K, A, below are abstract parameters used in the model presented in the reference paper. As described in the reference paper, these parameters can be extracted from typical cell manufacturer datasheets, see section 3. Section 3 also provides a table of example values for these parameters.
  • Parameters
    • E0: described as "battery constant voltage (V)" by the reference paper.
    • K: described as "polarization constant (V/Ah)" by the reference paper.
    • Q: battery capacity in Ah
    • R: internal resistance (Ohms)
    • A: described as "exponential zone amplitude (V)" by the reference paper.
    • B: described as "exponential zone time constant inverse (1/Ah)" by the reference paper.
    • Initial SOC: normalized value between 0 and 1 used as the starting State of Charge.
  • Inputs
    • the current (A) flowing through the cell. Positive is discharge.
  • Outputs
    • the dynamic voltage at the cell terminals (V)
    • the state of charge of the cell (normalized between 0 and 1)
  • Data Types
    • double
  • Events Zero Crossings
    • none

Delay

Delays the input signal by a fixed amount of time.
Presently there is a limitation with the delay block in that it only works when the simulation configuration Interpolation is ≥ 0.001.
  • Parameters
    • Delay: amount of time to delay the input signal.
    • Initial Output: when time is less than Delay, the block outputs this value.
  • Data Types
    • double

Integrator

In Collimator, Ordinary Differential Equations are drawn using the continuous integrator block. This block instantiates exactly one continuous state. The input to the block is the state derivative like this: input = dy/dt, output = y.
  • Features
    • Reset: enables resetting the integrator state to some value. the value can come from either the intial_state parameter or an input signal.
    • Hold: enables pausing of the integration action based on an input signal.
    • Limit: enable constraining of the integrator state within some bounds provided as values. When the state reaches one of the bounds, and the derivative tends to drive the state further, integration is prevented. When the state is at a bound, but the derivative tends to drive the state back to inside the bound, integration continues normally.
  • Parameters
    • Initial State: use this to set the value of the state at the start of the simulation.
    • Enable Reset: creates an additional input port to trigger reset of the state. Reset port is Boolean datatype and will trigger reset action continuously when input is high. When reset port is high, the state derivative is set to zero.
    • Enable External Reset: creates an additional input port used as the value to reset the state to. When unchecked, the value used in the initial_state parameter.
    • Enable hold: creates an additional input port for the hold signal.
    • Enable limits: exposes additional parameter value fields for providing the upper and lower limits.
  • Inputs
    • state derivative
    • [optional] reset
    • [optional] reset value
    • [optional] hold
  • Outputs
    • state value
  • Data Types
    • double
    • boolean
  • Events
    • when reset is enabled, an event is associated with the reset input, and an event is triggered for rising edge.
    • when hold is enabled, an event is associated with the hold input, and an event is triggered for both rising and falling edges.
    • when limits are enables, an event is associated with each limit relative to the state value, and an event is triggered when the state encounters the limit, and when it departs from the limit.

Transfer Function

Implements a typical transfer function as defined in https://en.wikipedia.org/wiki/Transfer_function
  • Parameters
    • Numerator: This input field is used to pass an array of coefficients for the numerator polynomial. the formatting of the input must be [Cn, Cn-1, .... C1, C0], where Cn is the coefficient of the nth power of s in the polynomial.
    • Denominator: This input field is used to pass an array of coefficients for the denominator polynomial. the formatting of the input must be [Cn, Cn-1, .... C1, C0], where Cn is the coefficient of the nth power of s in the polynomial.
  • Inputs
    • the input to the transfer function
  • Outputs
    • the output of the transfer function
  • Data Types
    • double
  • Events Zero Crossings
    • none
  • Parameters
    • Numerator: This input field is used to pass an array of coefficients for the numerator polynomial. the formatting of the input must be [Cn, Cn-1, .... C1, C0], where Cn is the coefficient of the nth power of s in the polynomial.
    • Denominator: This input field is used to pass an array of coefficients for the denominator polynomial. the formatting of the input must be [Cn, Cn-1, .... C1, C0], where Cn is the coefficient of the nth power of s in the polynomial.
  • Inputs
    • the input to the transfer function
  • Outputs
    • the output of the transfer function
  • Data Types
    • double
  • Events Zero Crossings
    • none
Implements a typical transfer function as defined in https://en.wikipedia.org/wiki/Transfer_function

Rigid Body

Implements three dimensional rigid body dynamics as described in https://en.wikipedia.org/wiki/Rigid_body_dynamics#Rigid_body_in_three_dimensions. Uses the yaw-pitch-roll convention for angular states.
The block can be configured to model only the translational degrees of freedom (3 DoF), or the combination of the translational and rotational degrees of freedom (6 DoF).
The mass and inertia properties of the block can independently be defined statically as parameters, or dynamically as inputs to the block.
The concept of moment of inertia used by the block is described in https://en.wikipedia.org/wiki/Moment_of_inertia
All parameters and states are in SI units.
  • Assumptions:
    • the inertia matrix is computed at the center of mass.
  • Parameters
    The parameters are organized with the translational parameters first, then the rotational parameters
    • The translational parameters are:
      • Enable external mass: check this box to expose an inport where the value of mass is provided. Note, when checked, the Mass parameter is not visible. When checked, the blocks expect the mass input value to be a scalar, with units of kilograms (kg).
      • Mass: the constant value for the body mass in kilograms (kg) when Enable external mass is unchecked.
      • Vx0: Initial velocity in the X direction (m/s).
      • Vy0: Initial velocity in the Y direction (m/s).
      • Vz0: Initial velocity in the Z direction (m/s).
      • Px0: Initial position in the X direction (m).
      • Py0: Initial position in the Y direction (m).
      • Pz0: Initial position in the Z direction (m).
    • Enable rotational DoFs: check this box to expose the parameters of the rotational degrees of freedom and enable the computation of the rotational states.
    • The rotational parameters are:
      • Enable external inertia matrix: check this box to expose an inport where the value of inertia matrix is provided. Note, when checked, the Inertia matrix parameter is not visible. When checked, the block expects the inertia matrix input value to be a 3x3 matrix, with units of (kg*m*m).
      • Inertia matrix: the constant value for the body inertia matrix in kg*m*m when Enable external inertia matrix is unchecked.
      • Wx0: Initial angular velocity around the X axis (rad/s).
      • Wy0: Initial angular velocity around the Y axis (rad/s).
      • Wz0: Initial angular velocity around the Z axis (rad/s).
      • ThetaX0: Initial angular position around the X axis (rad).
      • ThetaY0: Initial angular position around the Y axis (rad).
      • ThetaZ0: Initial angular position around the Z axis (rad).
  • Inputs
    • force_vector: This input requires a 3x1 vector of type double, with values in units of Newtons (N). The elements are [Fx, Fy, Fz] where F is the force along one of the axes. Positive values of force result in acceleration in the positive direction and vice verse for negative force values.
    • torque_vector: This input requires a 3x1 vector of type double with values in units of Newton*meters (Nm). The elements are [Tx, Ty, Tz] where T is the torque around one of the axes. Positive values of torque result in angular acceleration around the axis according to the right-hand-rule for normal vectors, and the opposite direction for negative torque values.
  • Outputs
    • translational_states: a 6x1 vector of with the following elements: [Vx, Vy, Vz, Px, Py, Pz]. Velocity states have units of (m/s), and position states have units of meters (m).
    • rotational_states: a 6x1 vector with the following elements: [Wx, Wy, Wz, ThetaX, ThetaY, ThetaZ]. Angular velocity states have units of (rad/s), and angular position states have units of radians (rad).
  • Data Types
    • double
  • Events Zero Crossings
    • none

State Space

Implements a typical state space system as defined in https://en.wikipedia.org/wiki/State-space_representation
  • Parameters
    the four input parameters are for the coefficients of the A, B, C, and D matrices.
    Collimator determines the expected shape of each matrix from the following values:
    • the size of the first dimension of the A matrix, number of rows, or length of the column.
    • the number of input ports
    • the number of output ports
    Collimator requires that A matrix be perfectly square, all rows must have the same length as there are number of rows.
    With this, Collimator can infer the required shape of the B, C and D matrices.
    1x1 matrices can be entered as [x] where x is the value of coeff.
    1xN or Nx1 matrices can entered as [x,y,z]. Collimator will infer the correct orientation for the provided vector.
    MxN matrices can be entered as [[w,x],[y,z]] where [w,x] is the first row, and [y,z] is the second row. Collimator can detect incorrect matrix dimensions, however, presently, it cannot re-orient matrices provided in transpose orientation. For example, [[a,b,c],[x,y,z]] has 2 rows and 3 columns, if the required matrix dimensions were determined to be 3 rows and 2 columns, Collimator will not presently reorient this, and it must be entered as [[a,b],[c,x],[y,z]].
    N states, M inputs, P outputs
    • A: An NxN array where N is the number of states. For example [[a1,a2,a3],[a4,a5,a6],[a7,a8,a9]] for 3 states.
    • B: An NxM array where N is the number of states, and M in the number of inputs. For example [[b1,b2],[b3,b4],[b5,b6]] for 3 states and 2 inputs.
    • C: An NxP array where N is the number of states, and P in the number of outputs. For example [[c1],[c2],[c3]] or [c1,c2,c3] for 3 states and 1 output.
    • D: An MxP array where M is the number of inputs, and P in the number of outputs. For example [[d1],[d2]] or [d1,d2] for 2 inputs and 1 output.
  • Data Types
    • double
  • Events Zero Crossings
    • none

PID

Implements a simple PID controller defined in https://en.wikipedia.org/wiki/PID_controller
  • Parameters
    • Kp: the proportional gain.
    • Ki: the integral gain.
    • Kd: the derivative gain.
  • Data Types
    • double
  • Events Zero Crossings
    • none