pypest / pyemu

python modules for model-independent uncertainty analyses, data-worth analyses, and interfacing with PEST(++)
BSD 3-Clause "New" or "Revised" License
174 stars 95 forks source link

Debugging model infeasibilty after running PESTPP-OPT #440

Closed Paszka1 closed 1 year ago

Paszka1 commented 1 year ago

This issue is rather a conceptual problem than directly related to PyEMU, so I apologize for that.

I wonder if there are any standard or recommended procedures to debug an infeasible model after running pest++opt? I.e., I'm over the first iteration (should be the only one as I'm not using chance constraints), the response matrix was successfully created, but I am unable to decipher the messages in the .rec file. More exactly, I understand that the model is infeasible, but the rest of the messages are a bit misty. Some of the messages are as follows:

I don't really have an idea how to find these infeasible constraints and, therefore, I don't understand the 'sum of infeasibilities' either. Any help or recommended readings are welcome. I basically checked - quite throughly - the .par and .rec files.

It may, or may not be related to the above, but I'm not sure if parval1 for multiplier decision variables can stay as one, or shall it be set to zero? I am using a value of one since I'm looking for optimizing future pumping rates relative to the current rates. Does that make sense? In addition, what if at least one of the constraints is not satisfied at the start of the prediction/optimization period? Can the algorithm handle this issue, or not? Could this eventually be the root of the original problem?

jtwhite79 commented 1 year ago

Assuming you are trying to minimize future pumping rates, if you set all decision variables to their minimum value, are all of the constraints satisfied (as single noptmax=0 run)?

with pestpp-opt, you can "hotstart" with that resp matrix and the rei file so save those and you can play with changing dv bounds, constraints, obj fxn, etc w/o needing to run the model

Paszka1 commented 1 year ago

Thanks Jeremy. I managed to solve the problem. I've started the optimization (maximization of pumping rates with minimum water levels as constraints) with some of the constraints already not being satisfied at the end of the calibration / beginning of the optimization period. I was expecting water levels to rebound above the constraint levels under optimal conditions, but apparently they don't. I removed those constraints from the optimization and Heureka.

I have to note that it was quite hard for me to understand all the "new" messages thay I got. This was both good and bad as it forced me to get into the subject more deeply, but as a non-native english it also gave me a hard time to decipher them.