QuadraticOpt.emam 512 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

package de.rwth.monticar.optimization;
//
component QuadraticOpt{

    implementation Math{
        Q^{3,3} A = [1,0,0;0,2,0;0,0,3];
        Q^{3,7} B = [1,1;2,2;3,3];
        Q^{3,2} C = [2,2,3;3,4,4];
        Q^{3} c = [4;5;6];
        Q d = 42;
        Q^{2} f = [3;3];
        Q^{2} h = [6;5];

        minimize
            Q^{3} x;
        in
           Q val = 0.5 * x' * A * x + c' * x + d;
        subject to
            //Debug restraint
          B * x <= f;
          C * x == h;
        end
    }
}