Home > FAQs
General
Who are the potential users of EcosimPro?
Can EcosimPro be used purely as a solver of algebraic and differential equations?
What is the main advantage of EcosimPro compared with popular block-oriented simulation environments like Simulink?
Is the terminology the same as that used by the classical object-oriented languages (C++, Java, etc.)?
What are the main advantages of object-oriented physical modelling?
Continuous and discrete modelling
Can EcosimPro be used purely for discrete simulation?
Can you write time events with EcosimPro?
Can one variable be made to follow another with a delay?
What is a virtual equation?
Discontinuities
Where should I represent the discontinuities in my component?
What is the main difference between using WHEN or ZONE?
Can the discontinuity of a function be modelled using ZONE or WHEN indiscriminately?
General
Who are the potential users of EcosimPro?
EcosimPro is a tool that can be widely used in many different fields:
- Science and Engineering:
-
- Simulation of continuous systems in sectors such as aerospace, energy, chemical, mechanical, electrical, fluids, etc. EcosimPro facilitates sophisticated studies of transients and steady states.
- Creation of component libraries in the different disciplines of physics and engineering.
- Scientists who want to solve differential-algebraic equation systems.
- In Education:
-
- It can be used as a tool for learning how to model systems.
Can EcosimPro be used purely as a solver of algebraic and differential equations?
It certainly can. Users who do not wish to make complex simulation models can use EcosimPro purely as an equation solver. All they have to do is encapsulate the equations in an EcosimPro component, compile it, create an experiment where you define the type of study you want to carry out (steady or transient) and see the results graphically or in an ASCII report.
What is the main advantage of EcosimPro compared with popular block-oriented simulation environments like Simulink?
The main advantage of EcosimPro is that it does not require causality when equations are written into the component and the order in which they are written is therefore not important. This means that the components are universal and that they can consequently be put to any use. Tools such as Simulink are less flexible and the order of the equations greatly restricts the performance of experiments that are slightly different.
Is the terminology the same as that used by the classical object-oriented languages (C++, Java, etc.)?
Let's see how the terminology changes:
| In Classical OO Programs | In EcosimPro |
|---|---|
|
Class Object Public inheritance Protected and Private inheritance Virtual method Aggregation |
Component Object Public inheritance (any inheritance is Public) Does not exit Virtual equation (there are no methods in EcosimPro) Aggregation |
What are the main advantages of object-oriented physical modelling?
Object-oriented system modelling has important advantages over other system modelling methods:
- Reuse of the modelling code through simple or multiple inheritance. This means that new models can be created by expanding on models that already exist, incorporating behaviour that is common to several models into a parent component that can be independently tested.
- Encapsulation of information. Modelling with objects, the modeller encapsulates in components the data and behaviour of physical models. This makes it easier to understand complex models and to follow their execution.
- Aggregation. Instances from other components can be aggregated into a single component. This makes it possible to successively create more sophisticated components based on more simple components.
Continuous and discrete modelling
Can EcosimPro be used purely for discrete simulation?
Yes, EcosimPro provides a very powerful event handling mechanism to cope with discrete simulation.
Can you write time events with EcosimPro?
Yes, using the statement AFTER. This statement delays certain functions; for example, if we write: x=y+2 AFTER 2.3 this means that the value of "x" will be equal to "y+2" 2.3 seconds from the actual time. Or, in other words, an event is prepared for the time TIME+2.3 in which integration will halt and the statement will be executed. It will then continue as normal.
This technique is widely used in the modelling of digital circuits to simulate delays in electronic components.
Can one variable be made to follow another with a delay?
Yes, you can do this by using the function delay(). This function creates a historic archive for the variable in question and it will return the value with a certain delay.
For example: x = delay(y, 2.3) This statement makes the value of "x" equal to the value of "y" after a delay of 2.3 seconds.
What is a virtual equation?
A virtual equation is an equation that is labelled with an identifier and that can be substituted by a different equation in a child component.
For example, given the component:
COMPONENT parent
DECLS
REAL x, y
CONTINUOUS
<myEq> y' = x / sin(TIME)
END COMPONENT
A child component may wish to modify that second equation:
COMPONENT child IS_A parent
CONTINUOUS
<:myEq> y'= x / cos(TIME)
END COMPONENT
The equation labelled "myEq" is what is known as a virtual equation. The child component substitutes it (it uses the substitute operator ":") for a new one.
Discontinuities
Where should I represent the discontinuities in my component?
The correct behaviour of models can only be guaranteed if the discontinuities are modelled with the statement ZONE. Modelling them in any other way will probably give rise to convergence problems.
A typical error is to write discontinuities into external function calls in FORTRAN or C. The system will not complain, but the model will not converge.
Another typical place where discontinuities are erroneously modelled is in experiments using IF statements.
Handling discontinuities is one of the most sophisticated parts in EcosimPro. A great deal of intelligence is required to go back in time and find the exact point where the discontinuity occurs. The user is therefore advised to take utmost care when it comes to modelling discontinuities. They should always be modelled using the above-mentioned statement and within the specification of components.
What is the main difference between using WHEN or ZONE?
The main difference is that WHEN is used for modelling discrete simulation events and ZONE is used for modelling conditional equations in continuous simulation. WHEN is associated with a code that is executed only once and that is when the condition is fulfilled. To re-execute the order, the condition must become first unfulfilled and then fulfilled again. On the other hand, what ZONE does is ensure is that one of the conditional equations is valid at all times.
For example, given the following discrete event:
WHEN (x > 5.0) THEN
PRINT("Ok")
END WHEN
The statement PRINT will be executed when the value of "x" is greater than 5, but if "x" then becomes less than 5, nothing will happen. The statement will be executed when "x" again becomes greater than 5.
However, given the continuous statement:
y = ZONE (x > 5) 8.
OTHERS 6.
EcosimPro will continuously check the condition "x > 5". When "x" becomes greater than 5, the first branch will be valid (y=8), but when this condition is no longer fulfilled ("x" becomes less than 5) the second branch becomes valid (y=6).
Can the discontinuity of a function be modelled using ZONE or WHEN indiscriminately?
If you want to model continuous behaviour, you should use the ZONE statement. By forcing the operator WHEN we could use it to model a discontinuity but, as we will see, this is not at all recommendable.
For example, we can model the following discontinuous function:
y = 8 if (x > 5), otherwise y = 6
Using ZONE this would be:
COMPONENT test
DECLS
REAL x, y
CONTINUOUS
y = ZONE (x > 5) 8.
OTHERS 6.
END COMPONENT
It can be modelled using two WHEN statements, as follows:
COMPONENT test
DECLS
REAL x, y
INTEGER flag
DISCRETE
WHEN (x > 5) THEN
flag = 1
END WHEN
WHEN (x <= 5) THEN
flag = 0
END WHEN
CONTINUOUS
y = 8 * flag + 6 * (1 - flag)
END COMPONENT
It can even be modelled yet another way, using just one WHEN statement:
COMPONENT test
DECLS
REAL x, y
INTEGER flag
DISCRETE
WHEN ((x > 5) OR (x <= 5)) THEN
IF (x > 5) THEN
flag = 1
ELSE
flag = 0
END IF
END WHEN
CONTINUOUS
y = 8 * flag + 6 * (1 - flag)
END COMPONENT
As we see, the most appropriate (and intuitive) is the first one.


