Gabriel,
Many "Thanks" for your assistance.
(1) I am aware of the --solver switch. I was just being lazy to not type it at the command line, so decided to put it in the script instead.
(2) I am a novice user of Pyomo, and not clear on the difference between Abstract Vs Concrete model. But, my ultimate model will have something like
instance1 = model.create()
instance1.Feed.Q = ...
...
instance1.preprocess()
instance2 = model.create()
instance2.Feed.Q = ..
...
instance2.preprocess()
where instance1 and instance2 will have same model structure, but different data. So, my naive thinking was that I should declare AbstractModel with correct structure once, and invoke it as many times as I want using model.create(). Any guidance you can offer to accomplish the goal, is appreciated.
(3) I was switching back and forth between pyomo and python to try to debug the problem I was having. So, I left the pyomo_postprocess method in the script just being lazy.
(4) Using Block() instead of the Struct() class certainly allows both pyomo or python to load and attempt to solve the model. So, now I have few related questions.
Q(4.1) I downloaded pyomo.pdf and CooprGettingStarted.pdf from the web. Neither one mentions anything about Block component. Is there a better place to learn all the features of pyomo?
Q(4.2) I was using Stuct class to declare a group of variables (Q,T,Ca,Cb,Cc), and allowing model.Feed and model.Prod to inherit the group. Using block component, now I have to define
model.Feed.Q = ...
model.Feed.T = ...
...
model.Prod.Q = ...
model.Prod.T = ...
...
etc. i.e. all the variables need to be declared twice. With Struct I just had to declare it once. Am I missing something?
Q(4.3) I got the definition of Struct class from the web. Obviously since it is not working, something is wrong with it. By any chance, do you see something that sticks out as wrong?
Q(4.4) With Block() now the model loads, and as mentioned earlier, attempts to solve. But it seems that it is not solved using the values I provided via instance.Feed.Q = ... commands. I thought that once I assign values via these commands, and issue instance.preprocess command, the model will solve using these values. Is there any other command that I need to issue?
The modified script file is attached. Again, appreciate your assistance.
-Kiran