« Previous « Start » Next »
8 TOMLAB Test Set
There are several test problems included with the TOMLAB
distribution. Three of the problems are illustrated below (P1, P4
and P10). These problems are created and solved by executing:
Prob1 = probInit('gp_prob', 3); % Create P1.
Prob2 = probInit('gp_prob', 6); % Create P4.
Prob3 = probInit('gp_prob', 12); % Create P10A.
Result1 = tomRun('GP', Prob1, 2); % Solve P1.
Result2 = tomRun('GP', Prob2, ,2); % Solve P4.
Result3 = tomRun('GP', Prob3, ,2); % Solve P10A.
Problem P1:
(P1) |
min |
5x1 + 50000x1−1 + 20x2 + 72000x2−1 + 10x3 + 144000x3−1 |
|
|
subject to |
4x1−1 + 32x2−1 + 120x3−1 <= 1 |
|
|
|
x ≥ 0 |
|
Using TOMLAB the problem is modeled as:
Problem P1 in TOMLAB:
|
A =
|
|
1 |
−1 |
0 |
0 |
0 |
0 |
−1 |
0 |
0 |
0 |
0 |
1 |
−1 |
0 |
0 |
0 |
−1 |
0 |
0 |
0 |
0 |
0 |
1 |
−1 |
0 |
0 |
−1
|
|
|
|
|
|
|
|
(10) |
|
|
coef =
|
|
5 |
50000 |
20 |
72000 |
10 |
144000 |
4 |
32 |
120 |
|
|
T |
|
|
|
|
(11) |
|
Prob = gpAssign(nterm, coef, A, 'P1');
Result = tomRun('GP', Prob, ,2);
similarly for the other test cases:
Problem P4:
(P1) |
min |
x1−1x2−1x3−1 |
|
|
subject to |
2x1 + x2 + 3x3 <= 1 |
|
|
|
x1 + 3x2 + 2x3 <= 1 |
|
|
|
x1 + x2 + x3 <= 1 |
|
|
|
x ≥ 0 |
|
Problem P4 in TOMLAB:
|
A =
|
|
−1 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
−1 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
−1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
1
|
|
|
|
|
|
|
|
(13) |
|
Prob = gpAssign(nterm, coef, A, 'P4');
Result = tomRun('GP', Prob, ,2);
Problem P10A:
(P1) |
min |
2x10.9x2−1.5x3−3 + 5x4−0.3x52.6 + 4.7x6−1.8x7−0.5x8 |
|
|
subject to |
7.2x1−3.8x22.2x34.3 + 0.5x4−0.7x5−1.6 + 0.2x64.3x7−1.9x88.5 <= 1 |
|
|
|
10x12.3x21.7x34.5 <= 1 |
|
|
|
0.6x4−2.1x50.4 <= 1 |
|
|
|
6.2x64.5x7−2.7x8−0.6 <= 1 |
|
|
|
3.1x11.6x20.4x3−3.8 <= 1 |
|
|
|
3.7x45.4x51.3 <= 1 |
|
|
|
0.3x6−1.1x77.3x8−5.6 <= 1 |
|
|
|
x ≥ 0 |
|
Problem P10A in TOMLAB:
|
A =
|
|
0.9 |
0 |
0 |
−3.8 |
0 |
0 |
2.3 |
0 |
0 |
1.6 |
0 |
0 |
−1.5 |
0 |
0 |
2.2 |
0 |
0 |
1.7 |
0 |
0 |
0.4 |
0 |
0 |
−3 |
0 |
0 |
4.3 |
0 |
0 |
4.5 |
−2.1 |
0 |
−3.8 |
0 |
0 |
0 |
−0.3 |
0 |
0 |
−0.7 |
0 |
0 |
−2.1 |
0 |
0 |
5.4 |
0 |
0 |
2.6 |
0 |
0 |
−1.6 |
0 |
0 |
0.4 |
0 |
0 |
1.3 |
0 |
0 |
0 |
−1.8 |
0 |
0 |
4.3 |
0 |
0 |
4.5 |
0 |
0 |
−1.1 |
0 |
0 |
−0.5 |
0 |
0 |
−1.9 |
0 |
0 |
−2.7 |
0 |
0 |
7.3 |
0 |
0 |
1 |
0 |
0 |
8.5 |
0 |
0 |
−0.6 |
0 |
0 |
−5.6
|
|
|
|
|
|
|
|
(16) |
|
|
coef =
|
|
2 |
5 |
4.7 |
7.2 |
0.5 |
0.2 |
10 |
0.6 |
6.2 |
3.1 |
3.7 |
0.3 |
|
|
|
|
|
|
|
(17) |
|
Prob = gpAssign(nterm, coef, A, 'P10A');
Result = tomRun('GP', Prob, ,2);
« Previous « Start » Next »