Subprograms

Subprograms define algorithms for calculating particular functions of a model. They divide complex model descriptions into smaller sections.

There are two forms of subprograms: procedures and functions. A procedure call is a statement; a function call is an expression and returns a value. A subprogram has two parts:

Subprograms can use constants, variables, and signals as parameters. The parameters used within a subprogram are called the formal parameters, while the parameters passed into the function or procedure are called the actual parameters.

Note that a simultaneous procedural statement is different from a subprogram. A procedural statement describes analog behavior that occurs sequentially (rather than be solved simultaneously).