Closed fsoepyan closed 5 years ago
@fsoepyan : Immediately after encountering this error, what are the contents of psuadelog in the working directory?
Below are the contents of psuadelog:
psuade> INFO: Creating a sample assuming all uncertain parameters are uniformly distributed.
PSUADE : Search for local minima in sample space. number of samples = 1 optimization starting point 1 : 7.09285750e+003 2.71795872e+003 1.16434754e-001 1.94058629e-001 -1.90002203e+008 -4.92101578e+008 -3.31029203e+008 -6.91168575e+008 2.92320312e+001 -8.05993567e+003 4.11246349e+000 5.06979330e+000 -2.31397522e+003 1.55276140e+000 -1.09545309e-001 8.74878919e+000 7.15953819e-001 Y = 1.00000000e+035
PSUADE OPTIMIZATION 1 (1) : starting X( 1) = 7.09285750e+003 starting X( 2) = 2.71795872e+003 starting X( 3) = 1.16434754e-001 starting X( 4) = 1.94058629e-001 starting X( 5) = -1.90002203e+008 starting X( 6) = -4.92101578e+008 starting X( 7) = -3.31029203e+008 starting X( 8) = -6.91168575e+008 starting X( 9) = 2.92320312e+001 starting X( 10) = -8.05993567e+003 starting X( 11) = 4.11246349e+000 starting X( 12) = 5.06979330e+000 starting X( 13) = -2.31397522e+003 starting X( 14) = 1.55276140e+000 starting X( 15) = -1.09545309e-001 starting X( 16) = 8.74878919e+000 starting X( 17) = 7.15953819e-001 starting Y = 1.00000000e+035
This optimization capability solves the following problem:
minimizeZ1 { Phi{Z3,Z4} [ G(Z1,Z2,Z3,Z4) ] }
subject to either: (a) bound constraints on Z1, Z2, and Z4 (use bobyqa); or (b) no constraint on Z1, Z2, and Z4 (use newuoa); or (c) inequality constraints on Z1,Z2,Z3,Z4 (use cobyla) as the level-1 optimizer.)
Z3 is a set of discrete parameters for which a sample
is to be provided by the user.
(0) How to perform regular optimization? In this case
(2) How to perform 2-level OUU? In this case
There are 2 options to how to set up G(Z1,Z2,Z3,Z4): (a) A user-provided level 2 optimizer that does
G(Z1,Z2,Z3,Z4) = minimize_Z2{F(Z1,Z2,Z3,Z4)}
where F(Z1,Z2,Z3,Z4) is embedded in G(Z1,...)
In this case, the user will provide G(Z1,...)
via opt_driver (i.e. opt_driver = gfunction)
(b) A user-provided function F(Z1,...) such that
G(Z1,Z2,Z3,Z4) = minimize_Z2 {F(Z1,Z2,Z3,Z4)}
In this case, user is expected to provide the
F(Z1,...) function via 'opt_driver = ffunction'
and OUU provides the optimizer (BOBYQA).
In case 1 and 2, Phi{Z3,Z4} is a functional on G(Z1,...) with respect to Z3 and Z4, e.g. Phi{Z3,Z4} may be:
In the above formulation, the total no. of parameters M = 17 These parameters are to be divided into four groups: (1) Stage 1 optimization parameters Z1 (M1 >= 1) (2) Stage 2 optimization (recourse) parameters Z2 (3) uncertain parameters Z3 (with a user-provided sample) (4) uncertain parameters Z4
To reuse simulation results (e.g. from before abrupt termination), turn on save_history and use_history optimization options in the ANALYSIS section (e.g. optimization save_history). You will see a text file called 'psuade_ouu_history' afterward.
In the following, please select type for each variable:
OUUOptimizer: setting optimization simulation driver.
====================================================================== Select which functional Phi_{Z3,Z4} to use:
@fsoepyan Could you send me the file you used?
@fsoepyan I assume you're using the large PosteriorSample file for "Load existing sample for Z4" and then selecting "Use Response Surface" because the sample size is so big.
Using Response Surface seems to give some problems when using constraints. If you don't select Response Surface, OUU runs without crashing (it will take forever with that sample size though).
It looks like we have an error in the script that runs psuade. I noticed this:
Type for variable 1 ? ERROR: input not within range.
Type for variable 1 ? Type for variable 2 ?
and this:
Select option 1 or 2 : ERROR: input is not an integer.
The PSUADE prompt to ask for M2 is missing but our FOQUS code is expecting it, which is probably what's screwing this up. Will ask Charles about this.
Answering Pedro's (@sotorrio1) question, I actually used the "Generate new sample for Z4" option under "UQ Setup".
For the "Sample Scheme", I selected "Latin Hypercube" with 20 samples.
Please follow the instructions in INSTALL.md and download psuade 1.7.10. Try again and let us know if the problem persists.
Here is what I did:
To use the newest version of psuade (version 1.7.10), what should I change the "PSUADE EXE" to?
I would go to the following link:
https://github.com/LLNL/psuade/releases
and download the "psuade_project-1.7.10-win32.exe" file. Then install psuade and for the new PSUADE EXE you would have 'C:\Program Files (x86)\psuade_project 1.7.10\bin\psuade.exe
Here is what I did:
Two separate issues here. It's true the new psuade version should be able to handle constraints and it's not. We'll double check with Charles if there is anything wrong with the driver and the commands sent to psuade. The stop button works, but when there is another error the communication with psuade stops and it's not getting any other messages/instructions. That's why it seems the stop button doesn't work
@sotorrio1 will follow up with Charles Tong on this.
Should be fixed with PR #270 @fsoepyan would you mind checking if it now works for you? Thanks!
@fsoepyan Are you running the example you sent me a while ago "MEA_Column_02_23_2018.foqus" ? The one with 17 inputs (X1-X4 are Z1 and the rest Z4), surrogate.negCO2 as the objective and C01, C02 and C03 as inequality constraints. I tried running that one and the issue I'm getting is that even if I tell OUU to generate the samples for Z4, it crashes because I didn't provide a sample file...
Do you get the same issue? Please send me the psuadelog.
Thanks!
@sotorrio1: Yes, I did run the OUU tab using the file that you mentioned, with the 17 variables, the negCO2 objective, and the 3 inequality constraints.
Below is the psuadelog:
psuade> ** PSUADE : Search for local minima in sample space. number of samples = 1 optimization starting point 1 : 3.84400000e+003 -7.74900000e+003 3.92000000e+000 1.75000000e+000 -1.34200000e+003 1.39000000e+000 0.00000000e+000 1.22000000e+001 5.58000000e-001 1.12400000e+003 1.60000000e-001 2.94000000e-001 -1.90490000e+008 -4.91270000e+008 -3.24303000e+008 -6.96303000e+008 2.89000000e+001 Y = 1.00000000e+035
PSUADE OPTIMIZATION 1 (1) : starting X( 1) = 3.84400000e+003 starting X( 2) = -7.74900000e+003 starting X( 3) = 3.92000000e+000 starting X( 4) = 1.75000000e+000 starting X( 5) = -1.34200000e+003 starting X( 6) = 1.39000000e+000 starting X( 7) = 0.00000000e+000 starting X( 8) = 1.22000000e+001 starting X( 9) = 5.58000000e-001 starting X( 10) = 1.12400000e+003 starting X( 11) = 1.60000000e-001 starting X( 12) = 2.94000000e-001 starting X( 13) = -1.90490000e+008 starting X( 14) = -4.91270000e+008 starting X( 15) = -3.24303000e+008 starting X( 16) = -6.96303000e+008 starting X( 17) = 2.89000000e+001 starting Y = 1.00000000e+035
This optimization capability solves the following problem:
minimizeZ1 { Phi{Z3,Z4} [ G(Z1,Z2,Z3,Z4) ] }
subject to either: (a) bound constraints on Z1, Z2, and Z4 (use bobyqa); or (b) no constraint on Z1, Z2, and Z4 (use newuoa); or (c) inequality constraints on Z1,Z2,Z3,Z4 (use cobyla) as the level-1 optimizer.)
Z3 is a set of discrete parameters for which a sample
is to be provided by the user.
(0) How to perform regular optimization? In this case
(2) How to perform 2-level OUU? In this case
There are 2 options to how to set up G(Z1,Z2,Z3,Z4): (a) A user-provided level 2 optimizer that does
G(Z1,Z2,Z3,Z4) = minimize_Z2{F(Z1,Z2,Z3,Z4)}
where F(Z1,Z2,Z3,Z4) is embedded in G(Z1,...)
In this case, the user will provide G(Z1,...)
via opt_driver (i.e. opt_driver = gfunction)
(b) A user-provided function F(Z1,...) such that
G(Z1,Z2,Z3,Z4) = minimize_Z2 {F(Z1,Z2,Z3,Z4)}
In this case, user is expected to provide the
F(Z1,...) function via 'opt_driver = ffunction'
and OUU provides the optimizer (BOBYQA).
In case 1 and 2, Phi{Z3,Z4} is a functional on G(Z1,...) with respect to Z3 and Z4, e.g. Phi{Z3,Z4} may be:
In the above formulation, the total no. of parameters M = 17 These parameters are to be divided into four groups: (1) Stage 1 optimization parameters Z1 (M1 >= 1) (2) Stage 2 optimization (recourse) parameters Z2 (3) uncertain parameters Z3 (with a user-provided sample) (4) uncertain parameters Z4
To reuse simulation results (e.g. from before abrupt termination), turn on save_history and use_history optimization options in the ANALYSIS section (e.g. optimization save_history). You will see a text file called 'psuade_ouu_history' afterward.
IF YOU ARE READY TO MOVE ON, ENTER 'y' AND RETURN : ====================================================================== *** OUUOptimizer detects nOutputs > 1. This will be interpreted to mean using cobyla to
Select which functional Phi_{Z3,Z4} to use:
@fsoepyan yeah, that's what I got. So basically I fixed the OUU handling constraints issue but now the psuade flow changed and we need to rewrite the script with the psuade commands. I'll keep you posted :)
Thank you!
@fsoepyan could you show me the psuadelog file? Thanks!
Below is the psuade log file. Thank you!
psuade> readOutput ERROR: nOutputs mismatch. check nOutputs in OUTPUT & PSUADEIO sections. PsuadeBase ERROR: cannot read file C:\Users\fsoepyan\DOCUME~1\FOQUS~1\OUU_FI~1\OUUTEM~1.OUU or wrong format. ERROR: run file not valid : check file format. psuade> command y not recognized psuade> command 4 not recognized psuade> command 0 not recognized psuade> command 0 not recognized psuade> command 1 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 1 not recognized psuade> command 1 not recognized psuade> command 1 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 4 not recognized psuade> command 1 not recognized psuade> command 2 not recognized psuade> command n not recognized psuade> command 1 not recognized psuade> command 20 not recognized psuade> command y not recognized psuade> command n not recognized psuade> psuade terminates ...
@fsoepyan could you clone my fork and try again? Thanks!
Sorry, I ran FOQUS using the wrong version.
The psuade log file from the FOQUS version from PR #270 is in the attached Word file. Thank you!
Do you get any error message?
Yes, and it says:
OUU: Optimization error. Please consult the FOQUS UQ developers for assistance.
That's odd... I just ran the problem getting the results below:
I tried to run OUU, where I have a constraint.