The Sims standard library
NOTE: Many of these components are unfinished or broken. These are mainly components that require events and support of discrete systems.
These components are available with Sims.Lib.
Normal usage is:
using Sims
using Sims.Lib
# modeling...Library components include models for:
- Electrical circuits
- Heat transfer
- Rotational mechanics
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 |
ModelingToolkit does not have variable types, so Signal, ElectricalNode, HeatPort, and Flange are all aliases of Any, mainly to help with documentation of models.
Current, Voltage, HeatFlow, Temperature, Torque, and Angle are all helper functions that create variables with gensym.
Signal
Sims.Lib.Signal — TypeSignal is an alias for Any used to indicate a signal value or variable.
ElectricalNode
Sims.Lib.ElectricalNode — TypeElectricalNode is an alias for Any used to indicate a node voltage value or variable.
HeatPort
Sims.Lib.HeatPort — TypeHeatPort is an alias for Any used to indicate a value or variable for a temperature port.
Flange
Sims.Lib.Flange — TypeFlange is an alias for Any used to indicate a value or variable for a flange port (an angle).
Discrete
Sims.Lib.Discrete — TypeDiscrete is an alias for Any used to indicate a value or variable that is Discrete.
Current
Sims.Lib.Current — FunctionCurrent(x = 0.0; name = :i) creates an Unknown with a default name of :i.
Voltage
Sims.Lib.Voltage — FunctionVoltage(x = 0.0; name = :i) creates an Unknown with a default name of :v.
HeatFlow
Sims.Lib.HeatFlow — FunctionHeatFlow(x = 0.0; name = :i) creates an Unknown with a default name of :hf.
Temperature
Sims.Lib.Temperature — FunctionTemperature(x = 0.0; name = :i) creates an Unknown with a default name of :T.
Torque
Sims.Lib.Torque — FunctionTorque(x = 0.0; name = :i) creates an Unknown with a default name of :torque.
Angle
Sims.Lib.Angle — FunctionAngle(x = 0.0; name = :i) creates an Unknown with a default name of :angle.
AngularVelocity
Sims.Lib.AngularVelocity — FunctionAngularVelocity(x = 0.0; name = :i) creates an Unknown with a default name of :angvelocity.
AngularAcceleration
Sims.Lib.AngularAcceleration — FunctionAngularAcceleration(x = 0.0; name = :i) creates an Unknown with a default name of :angacceleration.