The Sims standard library

These components are available with Sims.Lib.

Normal usage is:

using Sims
using Sims.Lib

# modeling...

Library components include models for:

Most of the components mimic those in the Modelica Standard Library.

The main types for Unknowns and signals defined in Sims.Lib include:

| | Flow/through variable | Node/across variable | Node helper type | | –––––––––- | ––––––––––- | –––––––––– | –––––––– | | Electrical systems | Current | Voltage | ElectricalNode | | Heat transfer | HeatFlow | Temperature | HeatPort | | Mechanical rotation | Torque | Angle | Flange |

Each of the node-type variables have a helper type for quantities that can be Unknowns or objects. For example, the type ElectricalNode is a Union type that can be a Voltage or a number. ElectricalNode is often used as the type for arguments to model functions to allow passing a Voltage node or a real value (like 0.0 for ground).

The type Signal is also often used for a quantity that can be an Unknown or a concrete value.

Most of the types and functions support Unknowns holding array values, and some support complex values.

Basic types

NumberOrUnknown

NumberOrUnknown{T,C} is a typealias for Union{AbstractArray, Number, MExpr, RefUnknown{T}, Unknown{T,C}}.

Can be an Unknown, an AbstractArray, a Number, or an MExpr. Useful where an object can be either an Unknown of a particular type or a real value, especially for use as a type in a model argument. It may be parameterized by an UnknownCategory, like NumberOrUnknown{UVoltage} (the definition of an ElectricalNode).

source

Signal

Sims.Lib.SignalConstant.

Signal is a typealias for NumberOrUnknown{DefaultUnknown}.

Can be an Unknown, an AbstractArray, a Number, or an MExpr.

source

Electrical types

UVoltage

An UnknownCategory for electrical potential in volts.

source

UCurrent

An UnknownCategory for electrical current in amperes.

source

ElectricalNode

ElectricalNode is a typealias for NumberOrUnknown{UVoltage,Normal}.

An electrical node, either a Voltage (an Unknown) or a real value. Can include arrays or complex values. Used commonly as a model arguments for nodes. This allows nodes to be Unknowns or fixed values (like a ground that's zero volts).

source

Voltage

Voltage is a typealias for Unknown{UVoltage,Normal}.

Electrical potential with units of volts. Used as nodes and potential differences between nodes.

Often used with ElectricalNode as a model argument.

source

Current

Current is a typealias for Unknown{UCurrent,Normal}.

Electrical current with units of amperes. A flow variable.

source

Thermal types

UHeatPort

An UnknownCategory for temperature in kelvin.

source

UTemperature

An UnknownCategory for temperature in kelvin.

source

UHeatFlow

An UnknownCategory for heat flow rate in watts.

source

HeatPort

Sims.Lib.HeatPortConstant.

HeatPort is a typealias for NumberOrUnknown{UHeatPort,Normal}.

A thermal node, either a Temperature (an Unknown) or a real value. Can include arrays. Used commonly as a model arguments for nodes. This allows nodes to be Unknowns or fixed values.

source

HeatFlow

HeatFlow is a typealias for Unknown{UHeatFlow,Normal}.

Heat flow rate in units of watts.

source

Temperature

Temperature is a typealias for Unknown{UHeatPort,Normal}.

A thermal potential, a Temperature (an Unknown) in units of kelvin.

source

Rotational types

UAngle

Sims.Lib.UAngleType.

An UnknownCategory for rotational angle in radians.

source

UTorque

An UnknownCategory for torque in newton-meters.

source

Angle

Sims.Lib.AngleType.

Angle is a typealias for Unknown{UAngle,Normal}.

The angle in radians.

source

Torque

Sims.Lib.TorqueType.

Torque is a typealias for Unknown{UTorque,Normal}.

The torque in newton-meters.

source

UAngularVelocity

An UnknownCategory for angular velocity in radians/sec.

source

AngularVelocity

AngularVelocity is a typealias for Unknown{UAngularVelocity,Normal}.

The angular velocity in radians/sec.

source

UAngularAcceleration

An UnknownCategory for angular acceleration in radians/sec^2.

source

AngularAcceleration

AngularAcceleration is a typealias for Unknown{UAngularAcceleration,Normal}.

The angular acceleration in radians/sec^2.

source

Flange

Sims.Lib.FlangeConstant.

Flange is a typealias for NumberOrUnknown{UAngle,Normal}.

A rotational node, either an Angle (an Unknown) or a real value in radians. Can include arrays. Used commonly as a model argument for nodes. This allows nodes to be Unknowns or fixed values.

source