Declare statements which should be executed once at the end of the simulation run

Syntax


terminal

   <list of statements/equations>

end

Description


The TERMINAL section is used to denote statements which should be evaluated exactly once at the end of the simulation run.  These statements typically include things like scaling of scalar (final value) model output quantities.  The TERMINAL section is not sorted, so care must be taken to place statement so that any inputs to a particular statement are computed by previous statements, contrary to the sorting done with DERIVATIVE section statements.


A model may have multiple TERMINAL sections, and they may be embedded in other section, such as a DERIVATIVE.  At build time, the Magnolia translator collects all TERMINAL sections a concatenates them in the order they were encountered in the file.

Example


terminal

   output_scaled = conversion_factor*output

end