Professional Documents
Culture Documents
Dynsim 5.3.2 Utilities: Simsci
Dynsim 5.3.2 Utilities: Simsci
Dynsim 5.3.2 Utilities: Simsci
DYNSIM® 5.3.2
Utilities
December 2016
All terms mentionedin this documentation that are known to be trademarks or service marks have
been appropriately capitalized. Schneider Electric Software, LLC. cannot attest to the accuracy of
this information. Use of a term in this documentation should not be regarded as affecting the
validity of any trademark or service mark.
Table of Contents
Introduction.................................................................................... 1
Summary of Models ......................................................................................... 1
Model Hierarchy .............................................................................................. 1
CustomMalfAnalog ........................................................................ 2
Discussion - CustomMalfAnalog...................................................................... 2
Data Entry Window Usage - CustomMalfAnalog............................................. 3
Parameter Table - CustomMalfAnalog ............................................................ 5
CustomMalfDiscrete ...................................................................... 7
Discussion - CustomMalfDiscrete.................................................................... 7
Parameter Table - CustomMalfDiscrete .......................................................... 7
GaussRand..................................................................................... 8
Discussion - GaussRand ................................................................................. 8
Data Entry Window Usage - GaussRand ........................................................ 8
Parameter Table - GaussRand........................................................................ 8
Integrator… .................................................................................. 10
Discussion - Integrator ................................................................................... 10
Data Entry Window Usage ............................................................................ 11
Parameter Table - Integrator ......................................................................... 11
MiscEqtn…. .................................................................................. 12
Discussion - MiscEqtn ................................................................................... 12
MiscEqtn Examples ....................................................................................... 12
Data Entry Window Usage - MiscEqtn .......................................................... 13
Parameter Table - MiscEqtn .......................................................................... 13
PackInt……................................................................................... 14
Discussion – PackInt ..................................................................................... 14
PackInt Example ............................................................................................ 14
Parameter Table – PackInt ............................................................................ 15
ProcLag…… ................................................................................. 16
Discussion - ProcLag ..................................................................................... 16
ProcLag Example .......................................................................................... 16
Data Entry Window Usage - ProcLag ............................................................ 17
Parameter Table - ProcLag ........................................................................... 17
ROC……….. .................................................................................. 18
Discussion - ROC .......................................................................................... 18
Data Entry Window Usage - ROC ................................................................. 18
Parameter Table - ROC ................................................................................. 19
RollAvg…… .................................................................................. 20
Discussion - RollAvg ...................................................................................... 20
RollAvg Example ........................................................................................... 20
Data Entry Window Usage - RollAvg ............................................................. 21
Parameter Table - RollAvg ............................................................................ 21
Utilities Contents - 1
Table of Contents
Utilities Contents - 2
Introduction
Introduction
The Utilities library provides a collection of standalone objects for various custom calculations.
Summary of Models
General Use Models
Model Hierarchy
ModelObject
|__________ CustomMalfAnalog
|__________ CustomMalfDiscrete
|__________ GaussRand
|__________ MiscEqtn
|__________ ProcLag
|__________ RollAvg
|__________ Roc
CustomMalfAnalog
Discussion - CustomMalfAnalog
CustomMalfAnalog extends ModelObject
The custom analog malfunction model is as a generic malfunction initiation interface to a custom
malfunction. The following example uses the custom analog malfunction to modify the normally
calculated value of a header temperature. In this example the output of the malfunction block
may be directly cross-referenced, since the value of the malfunction output will be equal to the
input, when it is not active. In other applications, it may be desirable to use the OUT parameter
as an input into other model calculations. There is also an integer output (STATE), which is 0
when the malfunction is inactive, and 1 when the malfunction is active.
CUSTOMMALFANALOG: MALF2
Example Temperature Deviation Malfunction
Parameter Assignment Units Description
In HCW1.T F Header temperature to be malfunctioned
Min 32.0 F Minimum malfunction value
Max 200.0 F Maximum malfunction value
DefaultOut 100.0 F Default malfunction value
NOTE: there is also an OUT parameter, which does not need to be initialized, and will be set
equal to either the IN parameter, or the value of the currently active malfunction.
Configuration Tab
Custom malfunction UOM corresponds to Input UOM Type. Selection of UOM type is based on
the variable being measured.
Basic Tab
Default malfunction value corresponds to the DefaultOut parameter. This is the default mature
value of the Out parameter when the malfunction is active.
Minimum malfunction parameter corresponds to the Min parameter. This is the minimum mature
value of the Out parameter when the malfunction is active. The mature value can be changed
through the malfunction interface.
Minimum malfunction parameter corresponds to the Max parameter. This is the maximum
mature value of the Out parameter when the malfunction is active. The mature value can be
changed through the malfunction interface.
Analog State
Name Description Units Model Eqt Array Sort Pnt Pnt
Allowed OK Size Out Dft Dft
Cls Val
Out Malfunction value POINT No N/A Yes DF 0.0
This value will be set
to IN, when the
malfunction is not
active, and set to the
current value of the
malfunction when it
is active.
State Malfunction state POINT No N/A Yes DI 0.0
0 = not active
1 = active
CustomMalfDiscrete
Discussion - CustomMalfDiscrete
CustomMalfDiscrete extends ModelObject
CUSTOMMALFDISCRETE: MALF1
Example Equipment Trip Malfunction
Parameter Assignment Units Description
NOTE: there is only 1 parameter (STATE), which does not need to be initialized.
OR: EQUIPTRIP
Example Equipment Trip
Parameter Assignment Units Description
Inp[0] ExtTrip1 Normal operating trip
Inp[1] ExtTrip2 Normal operating trip
Inp[2] MALF1.STATE Malfunction trip
GaussRand
Discussion - GaussRand
GaussRand extends ModelObject.
This model calculates a Gaussian distributed random number, for a given user mean and standard
deviation input. Note: The random number will be limited to within 5 standard deviations of the
mean.
Standard deviation corresponds to the Sigma parameter. The random number will be limited to
five standard deviations of the mean.
Outputs
Name Description Units Model Eqt Array Sort Pnt Pnt
Allowed OK Size Out Dft Dft
Cls Val
Out Random Gaussian POINT No N/A Yes DF 0.0
value
Integrator
Discussion - Integrator
The Integrator model calculates the Sum and the d(Sum)/dt (the integrated value).
The user defines the Input, Gain, and Bias. Results are in Sum and Output.
Out = ∫ Sum * dt
Input parameter corresponds to the In parameter, Gain in the Gain parameter, and Bias in the
Bias parameter.
MiscEqtn
Discussion - MiscEqtn
MiscEqtn extends ModelObject.
The MiscEqtn object allows for any number of user-specified equations or calculations. See the
Dynamic Simulation Suite User Manual for a discussion of equation operators.
MiscEqtn Examples
The following are examples of MiscEqtn objects.
MISCEQTN: BRGVIB
MiscEqtn used for bearing vibrations
Parameter Assignment Units Description
OUT[0] EQUATION Boiler Feed Pump Bearing vibration table lookup:
vibration vs. speed
Equation: CINTRP1(BFP.SPEED, BFPVIB[0])
OUT[1] EQUATION Boiler Feed Pump Turbine Bearing vibration table
lookup: vibration vs. speed
Equation: CINTRP1(BFPT.SPEED,BFPTVIB[0])
NOTE: The BFPVIB and BFPTVIB array definitions are not shown here and the BFP and BFPT
object definitions are not shown here.
Notice in the following example that the parameter specification begins with OUT[1] instead of
OUT[0]. This is perfectly legal and convenient because there is no feedwater heater 0. Also
notice that OUT[4] was skipped. This too is perfectly legal.
MISCEQTN: LFWH
MiscEqtn used for feedwater heater transmitter level calculations
Parameter Assignment Units Description
OUT[1] EQUATION Feedwater Heater 1 Transmitter Level
Equation: MAX(-15.0, MIN( 15.0, FWH1.L - 20.0))
OUT[2] EQUATION Feedwater Heater 2 Transmitter Level
Equation: MAX(-15.0, MIN( 15.0, FWH2.L - 20.0))
OUT[3] EQUATION Feedwater Heater 3 Transmitter Level
Equation: MAX(-15.0, MIN( 15.0, FWH3.L - 20.0))
OUT[5] EQUATION Feedwater Heater 5 Transmitter Level
Equation: MAX(-12.0, MIN( 12.0, FWH5.L - 18.0))
OUT[6] EQUATION Feedwater Heater 6 Transmitter Level
Equation: MAX(-12.0, MIN( 12.0, FWH6.L - 18.0))
NOTE: The FWH1, FWH2, FWH3, FWH5, and FWH6 object definitions are not shown here.
Notice in the following example that the parameter specification OUT[1] references the value
calculated in OUT[0].
MISCEQTN: LDA
MiscEqtn used for deaerator transmitter level calculations
Parameter Assignment Units Description
OUT[0] EQUATION Deaerator Level Transmitter A
Equation: MAX(-15.0, MIN( 15.0, DA.L - 20.0))
OUT[1] EQUATION Deaerator Level Transmitter B
Equation: MAX(-12.0, MIN( 12.0, LDA.OUT[0]))
NOTE: The DA object definition is not shown here.
Equation is attached to the OUT vector. This field accepts only equations. The result of the
equation is assigned to the OUT vector.
Parameter Assignment is attached to the OUT vector. This is an optional entry. The result of the
equation is assigned to any other model parameter or standalone point specified here.
PackInt
Discussion – PackInt
The PackInt model takes up to 32 integer inputs and packs them into a signed/unsigned, 32-bit
integer. Earlier PACKINT model was supporting only signed integer, but now a new output
parameter DOUBLEOUT is added which gets set for both signed and unsigned integers. Hence
user has to use DOUBLEOUT to pass an unsigned integer through Xref utility.
Here INTSIGN should be 0 for unsigned integer and 1 for signed integer.
To configure a PackInt object, expand the input array ‘IN’ and enter data in the appropriate array
index.
The OUT parameter is a 32-bit signed integer that represents the data entered.
Future development may allow the user to choose the output representation to be a signed
(INTSIGN = 1) or an unsigned (INTSIGN = 0) integer. Presently, INTSIGN is fixed at 1, and
thus the output is always a signed integer (i.e. if IN[31] is true, the OUT value is negative, if
IN[31] is false, the OUT value is positive).
Future development may allow the user to change the size of the packed word. Presently, the
number of inputs and the size of the output word are fixed at 32.
PackInt Example
The following table indicates the indexes of the IN array that are true and the resulting OUT
value.
ProcLag
Discussion - ProcLag
ProcLag extends ModelObject.
The ProcLag object provides a first order lag state of any number of process parameters. The
derivative for the ith process is given by:
ProcLag Example
The following is an example of how to configure a ProcLag object. This example is a simple
temperature model based on pump speed and has a lag that depends on pump running status.
PROCLAG: BFBP_TEMP
Boiler feed boost pump motor temperatures
Parameter Assignment Units Description
IN[1] EQUATION Lag setpoint
Equation: BFBP1.SPEED * 114.0
TAU[1] EQUATION Time constant
Equation: IF(BFBP1.POS, 0.25, 5.0)
IN[2] EQUATION Lag setpoint
Equation: BFBP2.SPEED * 115.0
TAU[2] EQUATION Time constant
Equation: IF(BFBP2.POS, 0.25, 5.0)
NOTE: The BFBP1 and BFBP2 object definitions are not shown here.
Input parameter reference corresponds to the In vector. Only parameter references are accepted
here.
Time constant corresponds to the Tau vector. Tau is the time constant used in a first order lag.
ROC
Discussion - ROC
The ROC (Rate of Change) model calculates a rate of change (RATE) of the input (IN) over a
filter time (FILTTIME). The user defines the number of samples in the buffer (NSAMPLE) and
the execution period (default PERIOD = DELT). The preprocessor calculates how many minutes
(AVGTIME) contained in the buffer.
Variable to be averaged
Name Description Units Model Eqt Array Sort Pnt Pnt
Allowed OK Size Out Dft Dft
Cls Val
In Input value POINT Yes N/A No DF 1.
RollAvg output
Name Description Units Model Eqt Array Sort Pnt Pnt
Allowed OK Size Out Dft Dft
Cls Val
Out Rolling Average POINT No N/A Yes DF 0
Output
RollAvg
Discussion - RollAvg
RollAvg extends ModelObject.
The user defines the number of samples (Nsample) and the period between samples (Period). The
object will calculate the averaging time period (AvgTime). The default Period of the RollAvg
object is 0.25 seconds.
The number of samples is calculated from the desired averaging time (in minutes) as follows:
RollAvg Example
The following is an example of how to configure a RollAvg object.
ROLLAVG: BH1TEMP
10 minute average, BagHouse temperature, compartment 1
IN BH1.T Value to be averaged
NSAMPLE 2400 Number of samples to average
2400 = 60*(10min)/0.25
NOTE: The BH1 object definition is not shown here.
Working variables
Name Description Units Model Eqt Array Sort Pnt Pnt
Allowed OK Size Out Dft Dft
Cls Val
Nsample number of samples POINT No N/A No KI 1440
to avg.
AvgTime Rolling Average min POINT No N/A No KF 0
Period
Isample current index in POINT No N/A No DI 0
Buffer
Jsample startup index POINT No N/A No DI 0
Sum Sum of stack values POINT Yes N/A No DF 0.
Zbuff history of In value POINT No NSA No SF 0.
MPLE
RollAvg output
Name Description Units Model Eqt Array Sort Pnt Pnt
Allowed OK Size Out Dft Dft
Cls Val
Out Rolling Average POINT No N/A Yes DF 0
Output
Oldest Oldest value stored, POINT No N/A Yes DF 0
used as delay
algorithm
The Conditional Sound Play model enables the user to link an alarm expression to a *.wav file of
their choice. When an alarm expression is true, the specified *.wav file plays. When an alarm
expression goes false, the sounding of the *.wav file stops.
The *.wav file is specified by the SOUNDFILENAME parameter. The *.wav file must be
located in a directory analogous to .\Simulations\SimulationName\sound where SimulationName
is the name of the simulation that contains the Conditional Sound Play object. Full path names to
alternate directories are not supported at this time. Only one *.wav file can be specified per
Conditional Sound Play object.
If the MODE parameter is 1, the *.wav file will play continuously until an OUT goes false. If the
MODE parameter is 2, the *.wav file will play once through, or until an OUT goes false,
whichever comes first.
If MODE = 1
OUT
OUT
OUT
If MODE = 2 and more than one OUT parameter is true, the once through play of the *.wav file
is reset when a new OUT becomes true.
OUT[0]
OUT[1]
In the example below, NOOFALARMS is set to 3. The OUT array is automatically sized to 3.
OUT [0] is set to the variable “di1” and OUT [1] is set to the variable “di2”. OUT [2] is set to the
output of the equation “di3+di4”. Thus, if either di3 or di4 goes true, OUT [2] will be true.
The MODE parameter is set to 2, which means that when any of the alarm expressions becomes
true, the firstup.wav file will play once through. In this example, the simulation in which the
Conditional Sound Play object resides is called “Test2”. The DYNSIM model version is 4.3.
The firstup.wav file must therefore reside in the following directory in order for the sound to
play: Installdrive:\SIMSCI TM \DSS43\Simulations\Test2\sound.
Equation is attached to the OUT vector. The result of the equation is assigned to the OUT
vector.
New rows must be saved by clicking Apply before editing their fields.
UnPackInt
Discussion - UnPackInt
The UnPackInt model takes a 32-bit signed/unsigned integer, unpacks its bits and represents them
as 32 separate integers in an output array.
Earlier UNPACKINT model was supporting only signed integer, but now a new input parameter
DOUBLEIN is added which gets set for both signed and unsigned integers. Hence user has to use
DOUBLEIN to pass an unsigned integer through Xref utility.
To configure an UnPackInt object, simply connect the ‘IN’ parameter to an integer value. In the
example below, DataPoint is a 32-bit signed integer (Dynamic Integer Point).
The OUT parameter is a 32-index array that represents each bit of the integer DataPoint as a
separate integer.
Future development may allow the user to choose the input variable to be a signed (INTSIGN =
1) or an unsigned (INTSIGN = 0) integer. Presently, INTSIGN is fixed at 1, and thus the input is
always a signed integer (i.e. if IN is positive, IN[31] is false, if IN is negative, IN[31] is true).
Future development may allow the user to change the size of the packed word. Presently, the
number of outputs and the size of the input word are fixed at 32.
UnPackInt Example
The following table indicates the indexes of the IN array that are true and the resulting OUT
value.
Data Import
Overview
This utility allows the real-time importation of text CSV data into a DYNSIM simulation.
Considerations have been made to support the different sampling rates and different time offsets
with the CSV data. Also, multiple components, each importing a different file, may be mixed and
matched within the simulation.
Parameter Settings
Parameter Configuration Choices
These are the parameters that need to be configured for each instance of the CSV Text File:
These are the parameters generated affect how the CSV Text File is managed:
Each named column except for the TIMESTAMP, in the first row of the data file, will be created
as new parameters in the model. Each of these parameters will have the data from the import file
at the specified timestamp, available to be used in the simulation.
CSV Configuration
The text file described here comes from a Microsoft Excel® spreadsheet using the Export
function. Other utilities may generate the file as described below.
The first row of the data file is the column heading names for each column of data. Each column
name will be imported as a separate parameter name to reference its data. This may instead be a
blank row.
The first column is always named TIMESTAMP, and it shows the number of seconds relative to
the beginning of the file.
Only valid tag names should be imported into the mode. To be a valid tag name, it should have at
least one letter in its name. Also, the name should consist of only the following: letters, numbers,
the period character, and the underline character. All lowercase letters in the tag name will be
converted to uppercase before being imported.
All the rows after the Label row are data rows. The values for each time sample are stored on one
line, separated by a comma. The first value must be the timestamp of the data in that row. The
format of the timestamp is “MM/DD/YY HH:MM:SS AM”. The year can be two or four digits. If
two digit year is used, it is in the range of 1970 to 2069. The seconds filed are optional. Also, the
AM/PM is optional, but strongly recommended.