Sims.Lib examples

Examples using models from the Sims standard library (Sims.Lib).

Many of these are patterned after the examples in the Modelica Standard Library.

These are available in Sims.Examples.Lib. Here is an example of use:

using Sims
m = Sims.Examples.Lib.ChuaCircuit()
z = sim(m, 5000.0)

using Winston
wplot(z)

Blocks

PID_Controller

Demonstrates the usage of a Continuous.LimPID controller

This is a simple drive train controlled by a PID controller:

Key parameters for plotting are:

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/blocks.jl:49

Electrical

CauerLowPassAnalog

Cauer low-pass filter with analog components

The example Cauer Filter is a low-pass-filter of the fifth order. It is realized using an analog network. The voltage source on n1 is the input voltage (step), and n4 is the filter output voltage. The pulse response is calculated.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:39

CauerLowPassOPV

Cauer low-pass filter with operational amplifiers

The example Cauer Filter is a low-pass-filter of the fifth order. It is realized using an analog network with op amps. The voltage source on n[1] is the input voltage (step), and n[10] is the filter output voltage. The pulse response is calculated.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:79

CauerLowPassOPV2

Cauer low-pass filter with operational amplifiers (alternate implementation)

The example Cauer Filter is a low-pass-filter of the fifth order. It is realized using an analog network with op amps. The voltage source on n1 is the input voltage (step), and n10 is the filter output voltage. The pulse response is calculated.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:132

CharacteristicIdealDiodes

Characteristic of ideal diodes

Three examples of ideal diodes are shown:

The resistance and conductance are chosen untypically high since the slopes should be seen in the graphics. The voltage across the first diode is (s1 - n1). The current through the first diode is proportional to n1.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:215

ChuaCircuit

Chua's circuit

Chua's circuit is a simple nonlinear circuit which shows chaotic behaviour. The circuit consists of linear basic elements (capacitors, resistor, conductor, inductor), and one nonlinear element, which is called Chua's diode.

To see the chaotic behaviour, plot n2 versus n3 (the two capacitor voltages).

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:270

HeatingResistor

Heating resistor

This is a very simple circuit consisting of a voltage source and a resistor. The loss power in the resistor is transported to the environment via its heatPort.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:313

HeatingRectifier

Heating rectifier

The heating rectifier shows a heat flow always if the electrical capacitor is loaded.

diagram

LBL doc link | MapleSoft doc link

NOTE: CURRENTLY UNFINISHED

Sims/src/../examples/lib/electrical.jl:340

Rectifier

B6 diode bridge

The rectifier example shows a B6 diode bridge fed by a three phase sinusoidal voltage, loaded by a DC current. DC capacitors start at ideal no-load voltage, thus making easier initial transient.

diagram

LBL doc link | MapleSoft doc link

NOTE: CURRENTLY BROKEN

Sims/src/../examples/lib/electrical.jl:403

ShowSaturatingInductor

Simple demo to show behaviour of SaturatingInductor component

This simple circuit uses the saturating inductor which has a changing inductivity.

diagram

LBL doc link | MapleSoft doc link

NOTE: CURRENTLY BROKEN

Sims/src/../examples/lib/electrical.jl:462

ShowVariableResistor

Simple demo of a VariableResistor model

It is a simple test circuit for the VariableResistor. The VariableResistor sould be compared with R2. isig1 and isig2 are current monitors

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:545

ControlledSwitchWithArc

Comparison of controlled switch models both with and without arc

This example is to compare the behaviour of switch models with and without an electric arc taking into consideration.

a3 and b3 are proportional to the switch currents. The difference in the closing area shows that the simple arc model avoids the suddenly switching.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:586

CharacteristicThyristors

Characteristic of ideal thyristors

Two examples of thyristors are shown: the ideal thyristor and the ideal GTO thyristor with Vknee=5.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/electrical.jl:642

run_electrical_examples

Run the electrical examples from Examples.Lib

Sims/src/../examples/lib/electrical.jl:734

Heat transfer

TwoMasses

Simple conduction demo

This example demonstrates the thermal response of two masses connected by a conducting element. The two masses have the same heat capacity but different initial temperatures (T1=100 [degC], T2= 0 [degC]). The mass with the higher temperature will cool off while the mass with the lower temperature heats up. They will each asymptotically approach the calculated temperature T_final_K (T_final_degC) that results from dividing the total initial energy in the system by the sum of the heat capacities of each element.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/heat_transfer.jl:30

Motor

Second order thermal model of a motor

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/heat_transfer.jl:49

Power systems

RLModel

Three-phase RL line model

See also sister models: PiModel and ModalModal.

WARNING: immature / possibly broken!

Sims/src/../examples/lib/powersystems.jl:19

PiModel

Three-phase Pi line model

See also sister models: RLModel and ModalModal.

WARNING: immature / possibly broken!

Sims/src/../examples/lib/powersystems.jl:53

ModalModel

Three-phase modal line model

See also sister models: PiModel and RLModal.

WARNING: immature / possibly broken!

Sims/src/../examples/lib/powersystems.jl:104

Rotational

First

First example: simple drive train

The drive train consists of a motor inertia which is driven by a sine-wave motor torque. Via a gearbox the rotational energy is transmitted to a load inertia. Elasticity in the gearbox is modeled by a spring element. A linear damper is used to model the damping in the gearbox bearing.

Note, that a force component (like the damper of this example) which is acting between a shaft and the housing has to be fixed in the housing on one side via component Fixed.

diagram

LBL doc link | MapleSoft doc link

Sims/src/../examples/lib/rotational.jl:33