www.delorie.com/gnu/docs/mcsim/mcsim_22.html   search  
 
Buy GNU books!


MCSim User' Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2.7 Output calculations

The output calculation section begins with the keyword CalcOutputs and is enclosed in curly braces. The equations given in this section will be called by the simulation program at each output time specified by a Print() or PrintStep() statement (see section 6.4.3 Print() specification, and see section 6.4.4 PrintStep() specification). In this way, the output scaling is done efficiently, only when values are to be saved, and not at each integration step.

Only variables that have been declared with the keyword Outputs can be changed in this section.

Assignments to other types of variables cause an error message like the following to be issued:

 
Error: line 56: 'Qb_fat' used in invalid context.
Only outputs can be defined in CalcOutputs{} section.

Any reference to an input or state variable will use the last calculated (current) value of the input. The dt() operator can appear in the right-hand side of equations, and it refers to values of the derivative as calculated at the last time step (see section 5.2.5 Dynamics specifications). Like in the Dynamics section, the integration variable can be accessed if referred to as t, as in:

 
Qx_out = DQx * t;


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003