Professional Documents
Culture Documents
Question No
Question No
2
proc nlp;
max f1;
decvar x1 x2 x3;
bounds x1>=0, x2>=0,x3>=0;
c1=X1*X1+x2*x2+x3*x3;
nlincon c1=1;
f1=8*x1*x2*x3;
run;
Solution:
PROC NLP: Nonlinear Maximization
Optimization Results
Parameter Estimates
Gradient
Objective
Estimate
Function
N Parameter
1 x1
2 x2
3 x3
0.577354
0.577356
0.577340
Gradient
Lagrange
Function
2.666648
2.666641
2.666712
-0.000038318
-0.000052093
0.000090414
Constraint
[
1 ]
c1
1.0000 3.452E-8
2.3094
*?*
Question no. 3
proc nlp;
max f1;
decvar x1 x2;
bounds x1>=0,x2>=0;
lincon 2*x1+3*x2<=6;
lincon -3*x1+2*x2<=3;
lincon 2*x2<=5;
lincon 2*x1+x2<=4;
f1=4*x1+3*x2;
run;
Solution:
The SAS System
52
Estimate
Gradient
Objective
Function
1 x1
2 x2
1.500000
1.000000
4.000000
3.000000
=
=
=
6.0000
3.0000
4.0000
+
-
2.0000 * x1
3.0000 * x1
2.0000 * x1
3.0000 * x2
2.0000 * x2
1.0000 * x2
Question no.4
proc nlp;
min f1;
decvar x1 x2;
bounds x1>=0,x2>=0;
lincon 3*x1+x2=3;
lincon 4*x1+3*x2>=6;
lincon x1+2*x2<=3;
f1=4*x1+x2;
run;
Solution:
The SAS System
44
N Parameter
Estimate
Gradient
Objective
Function
1 x1
2 x2
0.600000
1.200000
4.000000
1.000000
-2.22E-16
0
-2.22E-16
Question no. 5
proc nlp;
max f1;
decvar x1 x2;
bounds x1>=0,x2>=0;
lincon x1+4*x2-12<=0;
=
=
=
-3.0000
-6.0000
3.0000
+
+
-
3.0000 * x1
4.0000 * x1
1.0000 * x1
Linearly
Dependent
Active
Linear
Constraints
+
+
-
1.0000 * x2
3.0000 * x2
2.0000 * x2
f1=2*x1*x2+4*x2-2*x1**2;
ods rtf file='adref';
run;
ods rtf close;
Solution:
48
Estimate
Gradient
Objective
Function
1 x1
2 x2
1.000000
2.750000
1.500000
6.000000
12.0000
1.0000 * x1
4.0000 * x2