While editing your script, the object tree helps you by providing the object names. You can extend the branch of the object tree by placing a + icon in from of the name or by double-clicking the branch name. A double-click on one of the entries inserts the corresponding text in the EbsScript edit field
As such, writing or syntax errors can be avoided in the definition of the names.
The object tree is built every time the EbsScript Editor is started. If you delete, insert or rename components or pipes in the model, you must rebuild the object tree by using the command "Extras"à"Rebuild Object Tree".
The object tree consists of
To close a branch again, click on the - icon before the name.
Sometimes, there are sub-branches under the main branch. These sub-branches can be expanded and closed in the same way.
At the top of the tree display there is a text field that can be used to filter the tree display. There is also a drop-down button to the right that displays filter options.
As long as no capital letters are entered, the search is not case-sensitive. As soon as at least one capital letter is entered, the search is case-sensitive. If the search text begins with inverted commas ("), then the text must begin with the search text; if the search text ends with inverted commas, then the text must end with the search text.
In the object tree, the dot (.) is also used to search in the individual levels of the tree. A search text for the next level is created with each point. A search text can thus be created for each level (which can also contain inverted commas, for example).
The "Ignore namespaces" option ignores macro namespaces during the search, i.e. all objects (including those in macros) are searched for in the top level.
When you open the branch for a component or a pipe in the object tree, you see the attributes of these objects.
For a component, these are
When you expand an entry for a characteristic line, you can see the sub-entries getSize, param (if available), x and y. Double-click on getSize or on param to copy the expressions in the edit field, which are necessary for accessing the number points or the parameters of the characteristic lines. A parameter is available only when the corresponding characteristic line of the component possesses a parameter. By means of an double-click on x or y, copy the expressions in the edit field, which permit the access to a specific point (x or y value) of the characteristic line. You must specify the index in brackets [ ] e.g. Gas_turbine.CT2_1.y[2]. Note that the indices start with 1.
For a pipe, these are
Note that EbsScript offers read and write access to all values. Still, it is not advisable to modify the result values, because these are overwritten in the next calculation. More information about the units of the values is given in EbsScript Introduction.
In the specification property sheet of the components, there are certain entries, for which no value is to be entered, but instead an entry is to be selected from a drop-down list. The values are known as flags (their names start with an F). To access these flags from EbsScript, you must use the numeric values, which match the entries in the drop-down list. The numbers are given in the online Help or in the Excel templates. In the Standard Excel templates, you can move the mouse pointer over the red triangle in the corresponding Excel cell, which displays a tool-tip window showing the values of the numbers. Alternatively, you can also attach a value cross to the component and let the numeric value be displayed by disabling the check box "Value as Text".
A difficulty arises when you use object names that start with a number (e.g. a measurement point with the name 1RM00T011) . This would not be a problem for EBSILON®Professional, but in the naming conventions of PASCAL, the names must start with an alphabet. For this reason, the compiler gives an error message. To avoid this, the name must be placed in brackets. [ ]. Example: to access the measured value of the given measurement point, one uses the expression
[1RM00T011].MEASM
When you expand the branch @calcoptions or @parentoptions, you can see a list of expressions, which can be used in EbsScript for setting the options that are used for calculations. These expressions correspond to the options, which can be accessed through the tabs Simulation, Validation, Results and User-defined Fluids in the window "Extras"à"Model Options".
With EbsScript, you can use and set each of these options.
|
Option in the Model Options Window |
EbsScript expression |
Valid values in EbsScript |
Simulation |
Maximum number of iterations |
itmax |
> 17 |
|
Global calculation mode |
globalmode |
0 for Design |
|
Start of component relaxation (ITRX) |
startrelax |
> 17 |
|
Component relaxation till ITRX |
relaxupto |
0 for 0 |
|
Component relaxation after ITRX |
relaxafter |
0 for 0 |
|
End of the iteration at an accuracy of |
matprec |
0 for 10-4 |
|
Version of the Stodola law used for turbines in off-design |
stodola |
0 for the old version (ideal gas) |
|
Extreme relaxation |
extrelax |
0 for No |
|
Water-steam table |
watersteamtable |
0 for IFC-67 |
|
gastable |
0 for FDBR |
|
|
Reference temperature for net calorific value |
ncvreftemp |
Temperature in °C |
|
Parameter Alpha_T for radiation temperature |
alphat |
0 <= alphat <= 1 |
|
Flag, whether calculation time restriction is to be active |
usemaxtime |
0 for No |
|
Maximum calculation time |
maxtime |
Calculation time in seconds |
Validation |
End of the iteration at an accuracy of |
val.matprec |
0 for 10-3 |
|
Relaxation validation |
val.relax |
0 for 0 |
|
Validation method |
val.method |
0 for Ebsilon Standard |
|
Consideration of the material uncertainties |
val.table_uncertainties |
0 for No |
Type of the last calculation |
res.type |
1 for Simulation, |
|
|
Status of the calculation (see Chapter: |
res.status |
0: Successful |
res.status2 (new) |
0: Successful
1. Successful with Comments
2: Successful with Warnings
3: Error in Calculation
4: Error before Calculation / Calculation not possible
5: General Error
6: Maximum of Iterations reached
7: Maximum of Iterations reached with Warnings
8: Maximal Calculation-Time exceeded
9: Maximum of Iterations reached with Errors
10: License-Error
11. Already in Simulation Error 12. Internal-Error |
||
|
Total of the error squares during validation |
res.sqval |
>=0.0 |
|
Number of degree of freedom in validation |
res.freigr |
>=0 |
|
Number of iterations |
res.iter |
>=0 |
|
Calculation time (in ms) |
res.time |
>=0 |
|
max. residual time (in ms) |
res.rtimemax |
>=0 |
|
Chi^2-Test ratio during validation |
res.chi2 |
>=0.0 |
User-defined Fluid |
a1 (Coefficient of the cp-polynomial) |
usr.a1 |
real number |
|
a2 (Coefficient of the cp-polynomial) |
usr.a2 |
real number |
|
a3 (Coefficient of the cp-polynomial) |
usr.a3 |
real number |
|
a4 (Coefficient of the cp-polynomial) |
usr.a4 |
real number |
General Settings
The General Settings, which can be accessed through the EBSILON®Professional main menu through "Extras"à"General Settings", are mostly irrelevant for the EbsScript execution. There is one exception, where it is useful to modify the entry within the EbsScript: When you do a design calculation, EBSILON®Professional should know, whether reference values for the off-design calculation are to be updated or not. This is done via the variable @generaloptions.takeovernv:
Option in the window "General Settings", tab"Calculation" |
EbsScript expression |
Valid values in EbsScript |
Takeover nominal values |
takeovernv |
0 for No |
Other general options cannot be modified by EbsScript. Features, which require user interaction or an automatic output (e.g. for the validation results), are disabled during the EbsScript execution.