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 |
An ideal voltage source. |
|
Elements: Resistor |
The resistor. |
|
Elements: Capacitor |
The capacitor. |
|
Elements: Electrical Reference |
Grounding. |
|
Sensors: Current Sensor |
An ammeter. |
|
Sensors: 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. Place them on the canvas in the correct order and connect them as they are connected in a real electrical circuit.:
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.
Signal Recording ![]() |
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 |
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.
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 . The graphs show how when charging a capacitor, the current decreases exponentially, and the voltage across it increases.