1.3 The .EXE file for process optimization
For obvious reasons, the .EXE file for OPT is the single most important file for the on-line optimization. The model for the optimization is defined in the OCC file, which is located in a case directory. For example, the full pathname for the combined-cycle model is <c:/occ/models/combinedcycle/case01/combinedcycle.occ>.
1.3.1 Generating the OPT .EXE file
The OCC file can be created conveniently using the edit menu. The user can make use of the various pop-up menus, edit boxes and checkboxes to specify the OCOMA parameters. These include the method of discretization, solver version and number of timesteps. It goes without saying that the “On-line Optimization” checkbox has to be checked.
The user is basically free to choose the names of variables included in the process model to be optimized. However, these names may not end with “_sim” as this extension is reserved for analogous variables from the Simulink simulation (see 1.2). In addition, the variables names have to have at least two letters.
To generate the .EXE file, the user first has to run OCOMA to generate the necessary FORTRAN files. This can be done by clicking “Generate FORTRAN Code” on the off-line menu. Once this has been completed, click “Make Executable” to compile the files; this not only compiles the process model defined in the OCC file, but also links the entire NLP solver that the user has selected. The .EXE file thus generated is therefore complete in itself and can be renamed or moved to another case directory as the user pleases.
The .EXE file receives the name <exe_*.exe>, or <exe_*> for UNIX/LINUX operating systems, where * is the name of the OCC file without the extension “.occ”.
1.3.2 The OPT structure file
An auxiliary M-file is generated automatically when the user activates OCOMA to generate the FORTRAN codes. Similar to the .EXE file, the structure file is named <structure_*.m>, where * is the name of the OCC file without the extension “.occ”.
The structure file is extremely important during on-line optimization as it contains information about the structure of the process model and optimization parameters defined in the OCC file. It is therefore crucial that the .EXE and structure files have corresponding names[1] and are both found in the same case directory. For example, the file <combined_cycle.occ> generates both <exe_combined_cycle.exe> (or <exe_combined_cycle> in the case of Unix/Linux systems) and <structure_combined_cycle.m>.
The data that the structure file provides during on-line optimization are summarized in Table 1.
|
Variable/List
|
Description
|
Remarks
|
|
time
|
Vector containing value of all collocation points
|
|
|
varnames
|
List of all process variables
|
|
|
initialnames
|
List of all differential variables
|
|
|
measnames
|
List of all measured variables
|
Only relevant for ID
|
|
paranames
|
List of all process parameters
|
|
|
flexibound_mode
|
0: Fixed bounds for measured variables
1: Flexible bounds
|
Only relevant for ID
|
|
*_LOWER
|
Lower bound for variable *
|
Only relevant for ID
|
|
*_UPPER
|
Upper bound for variable *
|
Only relevant for ID
|
|
Table 1: Important information contained in structure file
An example of the structure file for combined-cycle power plant is shown below.
% Collocation points
time(1) = 12.5000000000;
time(2) = 64.47368421052632;
...
time(19) = 948.0263157894738;
time(20) = 1000.000000000000;
% The measured variables
measnames={
};
% Initial conditions
initialnames={
't_sh_steel_2'
't_sh_steel_1'
't_sg_steel_2'
't_sg_steel_1'
't_ec_steel_2'
't_ec_steel_1'
'p_drum'
'P_st'
};
%State variables
varnames={
't_gas_in'
'm_steam'
...
'p_drum'
'P_st'
};
% Parameters
paranames={};
FLEXIBOUND_MODE=0;
|