Engee documentation

Stages of building a physical model

Page in progress.

Let’s consider building a physical model using the example of an RC circuit. An RC circuit consists of a resistor and a capacitor. Such circuits are often used for signal filtering, pulse generation, timers, and other tasks.

Selecting and configuring ad blocks

We will use the library blocks to build the model. Physical Modeling from the section Fundamental Components/Electrical:

Subsection name and block name The block icon The object of the simulation

Sources: DC Voltage Source

dc voltage source

An ideal voltage source.

Elements: Resistor

resistor

The resistor.

Elements: Capacitor

capacitor

The capacitor.

Elements: Electrical Reference

electrical reference

Grounding.

Sensors: Current Sensor

current sensor

An ammeter.

Sensors: Voltage Sensor

voltage sensor

A voltmeter.

You can find the block you need by searching in the library or entering its name in the search field that appears when you double-click on the canvas.

To add a block to the model, drag it with the mouse from the block library. block library icon Place them on the canvas in the correct order and connect them as they are connected in a real electrical circuit.:

building physmod model 1

Immediately after adding the blocks, they have default values. To change the settings, double-click on the block or right-click and select Options:

  • Constant voltage source DC Voltage Source: parameter Constant voltage = `5 V'.

  • The resistor Resistor: parameter Resistance = `100000 ohms'.

  • The capacitor Capacitor: parameter Capacity = 0.00001 F.

Ammeter Current Sensor outputs current to port I, voltmeter Voltage Sensor — the voltage in the port is V. These signals can be connected to Terminator from the library Basic/Receivers and enable recording.

building physmod model 2

Signal Recording signal logging 1 allows you to save all simulation results to the `simout' variable. It collects only those signals for which recording is enabled. This variable allows you to save the simulation results to a CSV file in the future (for more information, see the article Software processing of simulation results in Engee).

By default, the `simout' variable is not created after the simulation of the model is completed. Check the box for it to appear. Save simulation results to workspace in settings window debug article icon 1:

simout open 1 en

For more information about building models in Engee, see Building a model.

Choosing a solver

Before the simulation, you need to choose a solver suitable for physical models. Usually, implicit solvers are used: Rosenbrock23, Rodas4, RadauIIA5, QNDF, ImplicitEuler, Trapezoid, TRBDF2, KenCarp4. They require fewer steps than explicit ones.

A physical model can include multiple networks. Each network (linked block diagram) requires one block Solver Configuration, which sets the parameters of the solver.

In this example, the parameters of the Solver Configuration block can be left by default.

building physmod model 3

After selecting the solver, all that remains is to select the simulation time and run the simulation.

Simulation results

Let’s see the results in the window signal visualization graphs icon 1. The graphs show how when charging a capacitor, the current decreases exponentially, and the voltage across it increases.

building physmod model 4 en

building physmod model 5 en