Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TEACHING
NOS_public
Commits
08158557
Commit
08158557
authored
Jul 25, 2016
by
Gianluca Frison
Browse files
added solution to ex01
parent
2f1dcd1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
exercises/ex01/solutions/genrosm.mod
0 → 100644
View file @
08158557
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;
exercises/ex01/solutions/sol01.txt
0 → 100644
View file @
08158557
|------------------|
| 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment