Hi,
I am reading data of several transformers from excel.
Now, I want to re-structure the data in order to handle each transformer “individually” using a piecewise-linear function at the end. To do so, I am copying the data from “a single parameter (1D)” to “another parameter (2D)”. Using let commands.
Since the data is not being read so far, this cannot work. Thus, I need to read the data before re-structuring it.
Nevertheless, the structure of the program splits between MODEL and DATA section, reading the data after defining the model. Is there a possibility to replace the let commands by other commands to be able to “move” the corresponding sommands into the model before reading the data?
Please have a look at the attached files.
You can define a param in terms of other sets and params, as you do for example when you define
param number_of_sampling_points{j in id_new}
= sum{i in TAP_TABLE_ID: id_characteristic[i]==j} 1;
This definition can be given before the data is read for the other sets and params (TAP_TABLE_ID and id_characteristic). However, for the data restructuring you need to use “let” which is a more general kind of executable assignment statement:
let {k in TAP_TABLE_ID}
p_step[id_characteristic[k],
k-sum{i in id_new: i<id_characteristic[k]}
number_of_sampling_points[i]] := step[k];
For a “let” statement, all of the needed data must already be known before the statement is executed.
Try moving the 3 “let” statements so that they come after the “read table add_tap” statement (but before “display step”). Does that fix the problem? If not, to get more help, send all lines of the error message that you see, and also attach the updated DoesNotWork.run file (showing the moved “let” statements).