Engee documentation

Customising physical blocks using target values

The target values are only configurable in the physical modelling blocks.

The model has parameters that are set directly (e.g. inductance and mass) and variables that change over time (e.g. current and temperature). Combinations of variable values can be incorrect (e.g. spring stretched but no force), while others show a normal or transient state of the system.

Use the physical variables window to view all target values of the model.

For example, two Capacitor (Advanced) blocks with the same parameters may work differently if one block has target values and the other block does not (see [physical variables] window). Example):

initial targets 01

initial targets 02

Without target values

With target value

It is important to note that target values are not initial conditions. They are reference points that help simplify model startup and tuning.

At the beginning of the simulation, Engee calculates the initial values of the variables to determine the starting point of the simulation. This process involves finding initial values for all variables in the system. Target values allow you to influence this process by setting priorities and initial values for specific variables at the block level. This can be done in the Initial Targets section of the settings window lk 5 of the respective blocks, for example:

initial targets 1

Each target value consists of a variable value, unit and priority. Here Current is the numerical value of the current through the capacitor. By default it is 0, measured in amperes and has a priority of None.

Priorities of target values

The values set when variables are initialised at block level are not their actual values, but target values at the start of the simulation. The solver can achieve some of them and some of them not. The solver tries to find a solution that:

  • fully satisfies all the high priorities;

  • brings the variables as close as possible to the target values, starting with the highest priorities.

Priorities determine how important it is for the solver to achieve specific target values when running the simulation:

  • `High' (high priority) - the solver tries to accurately achieve the target values for high priority variables.

  • Low (low priority) - after fulfilling all high priority targets, the solver tries to approach low priority target values. The accuracy of their achievement depends on the fulfilment of high-priority targets.

If too many target values are given, the solver may not be able to find an accurate solution for all high priority targets or may not be able to find a solution at all.

Example

To clearly demonstrate how target values work, build two identical models from blocks:

Leave the unit settings by default, but set the Capacitor voltage parameters to 1 for Capacitor unit of one of the models. For the signal lines between Inductor and Capacitor units, enable signal recording signal logging 1 as shown in the figure:

initial example 1

Select the following solver parameters in the settings window as shown:

initial solver 1

Run a simulation of the model start simulation button. The graph window stateflow graphs button shows a simulation of two electrical circuits, each of which is a resonant circuit with an inductance and a capacitor connected to a signal source .

initial example 2

From the graph it can be seen:

  • Capacitor-1.v - The blue curve shows damped voltage fluctuations on the first capacitor. This indicates that the initial conditions or circuit parameters have been set in such a way as to cause resonance in the circuit. The capacitor has a target value of Capacitor voltage = 1, which caused the damped voltage oscillations.

  • Capacitor.v - the orange line shows that the voltage across the second capacitor is almost unchanged, which may indicate that there is no initial oscillation as the parameters Capacitor voltage = 0, which explains the lack of significant voltage oscillations.

The comparison of the two models shows how target values can significantly affect the behaviour of physical systems. The model with a given target value exhibits damped voltage oscillations, while the second model remains at rest. This highlights the importance of setting the target values correctly to achieve the desired system behaviour.