causality

Navigation:  Modeling Tutorial > Iconic Diagrams >

causality

Previous pageReturn to chapter overviewNext page

The connection between two components describes the flow of power from one to the other. This power flow is always described by across and through variables. For example an electrical connection can be described by the variables voltage u and current i (u*i = power). Each Iconic Diagram component creates a causal relation between these variables. E.g. an electric resistor can be described by the equation:

 

u = i*R;

 

where R is the resistance. Here the voltage is a function of the current. In 20-sim we say the component has a voltage out causality. This causality is not fixed. We can easily invert the equation:

 

i = u/R;

 

Now the component has a current out causality. Which of the two equations will be used for the simulation depends on the other components.

 

In 20-sim an advanced algorithm detects the possible causalities of each model and tries to combine these in such a way, that optimal simulation code will be generated. You can help this algorithm by manually setting the causality of ports.