Commit 08158557 authored by Gianluca Frison's avatar Gianluca Frison

added solution to ex01

parent 2f1dcd1c
reset;
param n:=4;
var x{1..n} := 2, >= -2, <=2;
#var x{1..n} >= -2, <=2;
display x;
let x[1] := -1; #-1.0;
let x[2] := 1; # 0.5;
let x[3] := 1; # 0.4;
let x[4] := 1; # 0.3;
display x;
subject to
cons1: -400*(x[1]*x[2]-x[1]^3)-2+2*x[1] = 0;
cons{i in 2..n-1}: 200*(x[i]-x[i-1]^2)-400*(x[i+1]*x[i]-x[i]^3)-2+2*x[i] = 0;
consn: 200*(x[n]-x[n-1]^2) = 0;
#option solver conopt;
#option solver knitro;
#option solver loqo;
#option solver minos;
#option solver snopt;
option solver ipopt;
#option solver baron;
#option solver couenne;
solve;
display x;
|------------------|
| Solution of ex01 |
|------------------|
---
1.2
---
Starting on the y-axis (e.g. at (0,10)), the local solvers
- conopt
- knitro
- loqo
- minos
- snopt
- ipopt
can not find the global solution, and they end up with very large negative values of x.
On the other hand, the global solvers
- baron
- couenne
can find the global solution (3.0,0.5).
---
1.3
---
See beale_grad.mod
---
1.5
---
See genrosm.mod
Stationary points:
(1,1,1,1) -> global minimum
(-0.776,0.613,0.382,0.146) -> local minumum
(-0.656,0.443,0.204,0.042) -> saddle point
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment