- •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
11 Using Profiles in models |
77 |
11 Using Profiles in models
When you create model it often happens that parameters in the model are not constant, but instead are in the form of time-series. This could for example be a load profile on a display case in a supermarket.
To easily be able to include such profiles in your model, WinDali has a helper-tool called Profile Editor you can use to create profiles, and a corresponding Pascal unit called CmjsProfile.pas you can include in your model to use the profiles.
11.1 Generating profiles
When you execute the Profile Editor application, the following window appears:
You start by selecting the duration of the profile (when you simulate the profile will be looped) and by specifying the interval you want to provide data for.
When you press <Generate> you will see the following:
WinDali |
Morten Juel Skovrup |
78 11 Using Profiles in models
Note that now a table is created where you can enter values for the profile (in percent of a value you specify when you include the profile in a model), and that the profile will automatically be shown in the plot.
When you have entered the values, press <Save> to save the profile.
The format of a profile file is a simple ASCII file with the four first lines specifying the profile duration and the time interval:
The first line is equal to:
0:If duration is one minute
1:If duration is one hour
2:If duration is one day
3:If duration is one week
4:If duration is one month
5:If duration is one year
The second line is always equal to 1 (reserved for future use)
The third line is equal to
0:If time interval is given in seconds
1:If time interval is given in minutes
2:If time interval is given in hours
3:If time interval is given in days
4:If time interval is given in weeks
5:If time interval is given in months
The fourth line is equal to the specified time interval.
The rest of the file is just the entered percent-values – one value on each line.
WinDali |
Morten Juel Skovrup |
11 Using Profiles in models |
79 |
11.2 Using profiles in a model
Included in the demos is a modeified example of the "Cooling of Block" example, where a profile is used for the ambient temperature. This demo illustrates several points:
•Using an Action button to open a file from your model
•Changing the caption of an Info-label
•Loading and using a profile
•Using OnSaveSettings and OnLoadSettings to store information in files created from within the model.
When you use profiles then remember to:
1.Create the profile object in SetupProblem
2.Initialize the profile in PreCalc
The profile-object uses a linear interpolation to find profile values at each time step. If you want to improve this the change the code in CmjsProfile.pas located in the \Lib directory.
WinDali |
Morten Juel Skovrup |