- •Disclaimer
- •Contact information
- •Version information
- •Changes in version 3.00
- •Changes in version 2.20
- •Changes in version 2.10
- •Introduction
- •Typing convention
- •Terms used in this document
- •System structure
- •Creating a simple model
- •SetupProblem
- •ModelEquations
- •EndCalc
- •Compiling
- •Simulation
- •Model file format
- •Common parameters and datatypes
- •SetupProblem
- •SetupModel
- •SetupState
- •SetTimeFactor
- •SolverSettings
- •Dynamic variables
- •States
- •Static variables
- •Parameter pages
- •Initial Parameters
- •Floating point parameters
- •Integer parameters
- •Boolean parameters
- •List parameters
- •Enumerated parameters
- •Enumerated choice parameters
- •Explicit variables
- •Action buttons
- •Info Labels
- •HideSampleTime
- •Model help file
- •PreCalc
- •SetStartState
- •AddExplicitVar
- •SetSampleTime
- •ModelEquations
- •StateShift
- •OnStateChange
- •OnSolution
- •OnSample
- •EndCalc
- •OnQuit
- •OnUIValueChange
- •Running simulations from the model
- •OnSaveSettings
- •OnLoadSettings
- •Using Initial parameters
- •SetInitial
- •SetGuess
- •AddDynVar
- •AddStatVar
- •Mathematical text
- •Debugging
- •Common problems
- •Using refrigerant equations
- •WinDali Model Editor
- •Compiler Options
- •Environment Options
- •WinDali Simulation Interface
- •Menu commands
- •Online parameters
- •Varying parameters
- •Dali solver
- •Using Profiles in models
- •Generating profiles
- •Using profiles in a model
- •Using Post Process
- •Distributing models
- •References
54 6 Model file format
Example implementation var
T : array [1..10] of TFloat;
procedure PreCalc; begin
…
AddStatVar(1,T[1],10,'T1','Static Var 1'); AddStatVar(1,T[2],10,'T2','Static Var 2');
…
end;
6.15 Mathematical text
WinDali includes possibilities to make text appear in the Simulation Interface program with Greek letters and superand subscript.
To use this facility, you have to specify the Name/LongName parameter in calls to Add… functions using the following special characters:
•; Start/end special character section.
• _ Move text down. Creates subscript or moves text back to normal after a superscript.
•^ Move text up . Creates superscript or moves text back to normal after a subscript.
•A string specifying a Greek letter (see below).
Writing the string in lowercase creates the corresponding Greek letter in lowercase. Writing the string in uppercase creates the corresponding Greek letter in uppercase.
Examples:
'c;_;p;^; [kJ/kg-K]' will display as:
'alpha;_;i;^; [W/m;^;2;_;K]' will display as:
The following table shows the strings to include Greek letters:
WinDali |
Morten Juel Skovrup |
6 Model file format |
55 |
String |
Greek lowercase |
Greek uppercase |
'alpha' |
α |
Α |
'beta' |
β |
Β |
'gamma' |
γ |
Γ |
'delta' |
δ |
∆ |
'epsilon' |
ε |
Ε |
'zeta' |
ζ |
Ζ |
'eta' |
η |
Η |
'theta' |
θ |
Θ |
'iota' |
ι |
Ι |
'kappa' |
κ |
Κ |
'lambda' |
λ |
Λ |
'mu' |
µ |
Μ |
'nu' |
ν |
Ν |
'xi' |
ξ |
Ξ |
'omicron' |
ο |
Ο |
'pi' |
π |
Π |
'rho' |
ρ |
Ρ |
'sigma' |
σ |
Σ |
'tau' |
τ |
Τ |
'upsilon' |
υ |
Υ |
'phi' |
φ |
Φ |
'chi' |
χ |
Χ |
'psi' |
ψ |
Ψ |
'omega' |
ω |
Ω |
6.16 Debugging
For debugging purposes you can call the procedure DebugMsg:
Heading
procedure DebugMsg(Msg : PChar; Num : TFloat)
Parameters |
|
|
Msg |
Message to display |
|
Num |
An optional number to display (if Num is larger than 1E299 then the number is |
|
Shortcut |
not displayed). |
|
|
|
|
Write dbg and press <Ctrl>+J. |
|
|
Example |
|
|
DebugMsg('Pressure',P); |
{will display for ex. 'Pressure = 1.2'} |
|
DebugMsg('In ModelEq',1E300); |
{will display 'In ModelEq'} |
The messages you write with DebugMsg will appear on the Debug page in the Message Window in the Simulation Interface Program.
WinDali |
Morten Juel Skovrup |