summaryrefslogtreecommitdiff
path: root/tests/general_tests/lsqlin/lsqlin_logical2.sce
blob: 33cdc79090f26d9d430ba666414e90ed5e73861a (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// An example with inequality constraints
C = [1 1 1;
	1 1 0;
	0 1 1;
	1 0 0;
	0 0 1]
d = [89;
	67;
	53;
	35;
	20;]
A = [3 2 1;
	2 3 4;
	1 2 3];
b = [191
	209
	162];
Aeq = [1 2 1];
beq = 10;

//Output
//Optimal Solution Found.
// lambda  =
// 
//   lower: [0,0,0]
//   upper: [0,0,0]
//   eqlin: 73.833333
//   ineqlin: [2.571D-10,2.732D-10,2.571D-10]
// output  =
// 
//   Iterations: 7
//   ConstrViolation: 0
// exitflag  =
// 
//  0  
// residual  =
// 
//    37.666667  
//    54.75      
//    55.25      
//  - 18.583333  
//  - 19.083333  
// resnorm  =
// 
//    8178.4167  
// xopt  =
// 
//    53.583333  
//  - 41.333333  
//    39.083333 

[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq)