Скачиваний:
21
Добавлен:
25.04.2015
Размер:
1.28 Mб
Скачать

6 Model file format

53

Example implementation var

T : array [1..10] of TFloat; P : TFloat;

procedure PreCalc; begin

P := 1;

T[1] := 10;

T[2] := 10;

AddDynVar(T[1],10,'T1','Temperature 1'); AddDynVar(T[2],10,'T2','Temperature 2');

AddDynVar(P,1,'P','Pressure'); end;

6.14.4 AddStatVar

AddStatVar is used to add static variables just before the simulation begins (i.e. after the user starts the simulation, but before ModelEquations is called the first time). AddStatVar is normally called in PreCalc.

Heading

function AddStatVar(State : TInteger; var Variable : TFloat; InitalGuess : TFloat; Name,LongName : PChar) : TInteger;

function AddStatVarExt(State : TInteger; var Variable : TFloat; InitalGuess : TFloat; Name,LongName : PChar; Min,Max : TFloat; DoPlot : TBoolean; ALabel : PChar) : TInteger;

Parameters

 

State

The state the static variable belongs to.

Variable

The declared pascal variable, which represents the variable in the model.

InitialGuess

The default guess on the static variable.

Name

Short name that appears on plots.

LongName

Long name, appears on the Guesses page in the Solver & Model settings

Min

window in the Simulation program.

Minimum value the user can set the variable to (and limit for the static

Max

equation solver).

Maximum value the user can set the variable to (and limit for the static

 

equation solver).

DoPlot

If Min = Max = 0 then no limits are set.

True: Plot/save is available to the user for this variable

Return value

False: Plot/save is not available to the user for this variable.

 

The number assigned to the static variable. Can be used to identify the variable in calls to

SetGuess.

WinDali

Morten Juel Skovrup

Соседние файлы в папке Model and programs
  • #
    25.04.201512 б17heatrecoverysystem.LoadPrf
  • #
    25.04.2015249.28 Кб17heatrecoverysystem.set
  • #
    25.04.201537.38 Кб20Model help.doc
  • #
    25.04.2015509 б18SimIntPlt.cnt
  • #
    25.04.201562.07 Кб17SimIntPlt.hlp
  • #
    25.04.20151.28 Mб21WinDali.pdf