Engee documentation

Block diagrams for modelling and simulation of dynamic systems

Engee is a platform that includes both a scripting language for computing and a visual environment for developing control systems and modelling complex technical systems.

Visual modelling environment allows to build models of any level of detail - from an atomic physical component to a system model of a complex object. The main purpose of Engee is modelling and simulation of dynamic systems, i.e. those whose state depends on time.

Examples of dynamic systems:

  • Water fills a bucket - water comes in at a certain rate and the bucket gets heavier. In that case, a separate block can represent the bucket: the input is the flow rate and the output is the weight of the bucket.

  • You speak into a megaphone - the sound of your voice is processed, and broadcast amplified many times. Here a megaphone can be represented as a block: the voice (sound wave of the source) is its input, and what is heard by others (sound wave at the receiver) is the output.

  • You push the cart - the cart moves. The cart will be the block: the force you apply is the input, and the position of the cart is the output.

Engee provides libraries (sets) of blocks grouped by functionality.

For example, to model a megaphone that multiplies its input by a constant, let’s use the Gain block from the Math Operations library.

gain

The arrows -> denote the inputs and outputs of the block, which can be used to connect it to others.

A sound wave enters the megaphone at the input, and a louder version of the same wave leaves it at the output.

To simulate a sine wave entering the megaphone in Engee, switch on the source Sine Wave Function.

block diagrams 1

Blocks can be connected to each other to form individual subsystems, which in turn make up a model of the system as a whole.

For example, an audio player turns a digital file into sound. The digital representation is read from memory, mathematically interpreted and then turned into the actual sound. The software that processes the digital file to calculate the sound waveform can be represented by a single unit. The speaker that takes the waveform and turns it into sound is another. Finally, the component that generates the input signal in the model, which simulates reading from memory, represents a third block.

Recall that the main function of Engee is to model the behaviour of system components over time. At its simplest, this task involves the following steps: . determining the current point in time within the simulation; . determining the order of calculating the output values of blocks for this moment of time; . formation of output values of each block in order.

As an example, consider again the megaphone. At each time step Engee must calculate the value of the sinusoid, transfer it to the input of the block Gain (representing the megaphone itself), and then calculate the value of its output.

At each time step, each block calculates the values of its output signals based on the values of the signals at the inputs. Once all signals in the diagram are computed at a given time step, Engee determines the time of the next counting step (based on the model configuration and the selected solver) and brings the simulation clock forward. Each block then repeats the computation for this new time step.

In the simulation, time runs differently than in the real world. Each counting step takes as long as it takes to complete the computation for that time step - whether that counting step represents a fraction of a second or several years.

Engee processes data in three categories:

  • Signals - values at inputs and outputs of the block calculated during modelling.

  • States - internal values representing the block dynamics calculated during the simulation.

  • Parameters - values affecting the block behaviour, set by the user.

Values of signals and states are calculated at each step of Engee counting. Parameters values are set when the model is built (although sometimes they can be changed during simulation).