<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«



MODELS is a general-purpose description language supported by a set of simulation tools for the representation and study of time-variant systems. This help file is to a large extent an extract of the Language Manual MODELS IN ATP, February 1996, written by Laurent Dubé. Please consult this manual for more detailed information on the MODELS language.  


ATPDraw supports only a simplified usage of MODELS as shown in Models in ATPDraw. In general ATPDraw takes care of the interface between MODELS and the electrical circuit (INPUT and OUTPUT of the MODELS section) and the execution of each Model (USE). To use MODELS in ATPDraw the user must write a model file which is a text file starting with MODEL name and ending with ENDMODEL as shown in Model structure. ATPDraw only supports INPUT, OUTPUT and DATA in the USE statement.


Several examples are included in this help file, most of them created by Laurent Dubé. They are categorized into:

Arrays How to work with arrays in MODELS

Calculus Laplace, differential equations, and integrals

Controls Control statements and loops: if, do, for and while

Delay How to work with time delays in MODELS

Expressions Operators and expressions. Series

Functions Functions in MODELS

History&Init Initializing of variables

Limits Limits on expressions

Resident Resident functions and constants

Other Some other real examples. Lightning-induced voltage calculations.


Besides, this help file contains a brief description of expressions in MODELS and a list of resident functions and variables/constants.


The MODELS editor supports extensive syntax highlighting, indent, code-folding, insert of templates and a debugger.




MODELS is a general-purpose description language supported by a set of simulation tools for the representation and study of time-variant systems.

The MODELS language provides a format which focuses on the description of the structure of a model and on the function of its elements.

The description of a model is intended to be self-documenting, and can therefore be used both as the description document used for representing the system and as the data used in the actual simulation.

A system can be described in MODELS as an arrangement of inter-related sub models, independent from one another in their internal description (for example, in selecting the names of their variables) and in their simulation (for example, in selecting the size of their individual simulation time step).

There is also a clear distinction in MODELS between the description of a model, and the use of a model. Individual models can be developed separately, grouped in one or more libraries of models, and used in other models as independent building blocks in the construction of a system.

Finally, the description of each model uses a free-format, keyword-driven syntax of local context, and does not require fixed formatting in its representation.

The present documentation is divided in two sections, the first covering the description of a model, and the second describing the use of a model in a simulation.

A general overview of the model description approach in MODELS is presented in the next pages, under the headings MAIN FEATURES, SYSTEM REPRESENTATION, MODEL DECOMPOSITION, and MODEL DEFINITION.


The MODELS syntax is similar to FORTRAN but much more powerful in terms of working with time domain signals, delays, lapacians, differential equations, limits etc. Arrays with powerful group assignments supported, but not matrices nor complex numbers.

Input to MODELS can be node voltages, switch current/status, machine variables, TACS signals, Models outputs (this model must come first), ATP constants, imaginary part of steady-state voltage and currents (real part passed in with voltages and currents at time zero, and captured in INIT).

All OUTPUT must also be declared as VAR.

All variables used in delay funcions store their 100 previous values, by default. This can be changed with the DELAY CELLS command.

Integrals and delays must be initialized, same with laplacial denominators. This is done with the HISTORY command.

Syntax mistakes are reported in the LIS-file and identified by inspecting where the interpretation halts.

Comments out the rest of line by '--' (double minus). Block comments enclosed by 'comment' - 'endcomment' keywords.

The internal timestep can be set for each model.



The main description features of the MODELS language are the following:

- the syntax of MODELS allows the representation of a system to closely follow the system's functional structure, supporting the explicit description of composition, sequence, concurrence, selection, repetition, and replication;

- the description of a model can also be used as the model's documentation;

- the interface of a model with the outside world is clearly specified;

- the components of a model can be given meaningful names representative of their function;

- a system can be partitioned into individual sub models, each with a local name space;

- the models and functions used for describing the operation of a system can be constructed in programming languages other than the MODELS language.

The main simulation features supported by the MODELS language are the following:

- distinction between the description of a model and its use, allowing multiple independent replications of a model with individual simulation management (time step, dimensions, initial conditions, etc.);

- hierarchical combination of three initialization methods (default, use-dependent, and built-in), each contributing to the description of the pre-simulation history of a model by a direct representation of the pre-simulation value of its inputs and variables as functions of time;

- dynamically-controlled modification of the values of the inputs and variables of a model during the course of a simulation;

- dynamically-controlled modification of the structure of a model (both topological composition and algorithmic flow) during the course of a simulation.