Function Call

1 Polynomial Evaluator

There are two basic forms a of function call in Modelica: positional or named association to formal parameters. We will as an example use the function PolynomiaEvaluator, which computes the value of a polynomial given two arguments: a coefficient vector A and a value of x.



2 Positional Call

Function calls with positional association of actual arguments to formal parameters is the most common form of function call. The actual arguments are associated with the formal parameters according to their position in the argument list.

Using positional association {1, 2, 3, 4} becomes the value of the coefficient vector
A and 21 becomes the value of the formal parameter x.



3 Simulation of PositionalCall





4 Named Call

The same call to the function PolynomialEvaluator can instead be made using named association of actual arguments to formal parameters. Here the actual argument is associated with the formal parameter through an equation in the argument list.



5 Simulation of NamedCall




Direct positionalcall: