Engee documentation

Stages of building a physical model

Page in progress.

Let’s consider the stages of building a physical model on the example of building a model of RC-circuit. RC circuits are electrical circuits consisting of resistors and capacitors. They are widely used in various applications such as signal filtering, pulse generation, timers and many others.

Selecting and configuring blocks

To build the model we will use the blocks of the Physical Modelling library from the Fundamental/Electricity section:

Subsection name and block name Block icon Modelling object

Sources: *DC Voltage Source

dc voltage source

The ideal voltage source.

* Elements: Resistor

resistor

Resistor.

* Elements: Capacitor

capacitor

Capacitor.

* Elements: Electrical Reference

electrical reference

Earthing.

* Sensors: *Current Sensor

current sensor

Ammeter.

* Sensors: *Voltage Sensor

voltage sensor

Voltmeter.

The required block can be found by searching the block library or by entering the block name in the search field that appears by double-clicking on the canvas.

To add blocks to the model, drag them from the Block Library to the canvas using the left mouse button, arrange them in the desired order and connect them as they would be connected in a real electrical circuit:

building physmod model 1

Once a block is added, its parameters are set by default. To view and change parameters of a block, double left-click on the required block, or right-click on the block and select Parameters:

  • For the DC voltage source DC Voltage Source set the Constant voltage parameters to 5 V.

  • For a resistor Resistor set the Resistance parameters to `100000 ohms'.

  • For capacitor Capacitor set the Capacitance parameters to 0.00001 F.

The measurement results of the ammeter Current Sensor and voltmeter Voltage Sensor are output to the I and V ports respectively. Each can be connected to a Terminator block from the Basic/Receivers library and recording can be enabled for each signal line.

building physmod model 2

Thanks to signal recording you can save all simulation results in the workspace. To do this, you must enable signal recording in the simulation settings and then the simout variable will appear in the workspace according to the simulation results. This variable allows you to save the simulation results to a file in CSV format. The variable collects information only for those signal lines for which signal recording is enabled, if you do not record a particular signal - its results will not be taken into account in the variable simout. More information about saving simulation results can be found in the article Software processing of simulation results in Engee.

More information about building models in Engee can be found at Model building.

Selecting a solver

Before running the simulation, it is important to select a solver suitable for physical modelling in the model settings. For physical models it is recommended to use implicit solvers such as Rosenbrock23, Rodas4, RadauIIA5, QNDF, ImplicitEuler, Trapezoid, TRBDF2, KenCarp4. Implicit solvers require fewer time steps than explicit solvers.

A physical model may consist of multiple networks. Each physical network, represented by a linked block diagram, requires information about the solver settings. For this purpose, the block Solver Configuration must be connected to each network. It sets the solver parameters that your model needs before you can start the simulation. Each topologically distinct block diagram requires that only one Solver Configuration block be connected to it.

In this example, the Solver Configuration settings can be left by default.

building physmod model 3

After selecting the solver and setting the simulation time, the simulation can be started.

Simulation results

Let’s turn to the graph window to evaluate the results taken from the sensors. As a result, we can see how the current flowing exponentially decreases as the capacitor is charged and how the voltage of the charged capacitor increases.

building physmod model 4

building physmod model 5

For more information on working with charts in Engee, see Graphs.