Using the Traditional Approach


Below, we show how to model a tank system using the traditional approach. A tank system with a tank, a source for liquid, and a controller.


1 FlatTank Model

The FlatTank model is a "flat" model of the tank system with no internal hierarchical "system structure" visible, i.e., just a collection of variables and equations that model the system dynamics. The internal system structure consisting of components, interfaces, couplings between the components, etc. is not reflected by this model.



2 The limitValue Function

A limiter function is needed in the model to reflect minimum and maximum flows through the output valve:



3 Examples of Calling limitValue

Three calls. a) 6 is between 4 and 10; b) 3 is less than 4 which is returned; c) 12 is greater than 10 which is returned.





4 Take a Look at the Flattened FlatTank Class


5 Simulation of FlatTank




Diagram 1: Simulation of the FlatTank model with plot of the tank level.