BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rohailk
Obsidian | Level 7

hi,

I am trying to solve the following problem

 

Capture.JPG

The initial point is =(0 0 0)

My code is the following

proc optmodel;
var x{1..3};
min f = x[1]^2  + 2*x[2]^2 + 5*x[3]^2 - 4*x[1] - 20*x[2] - 20*x[3] ;

/* starting point */
   x[1]= 0;
   x[2]= 0;
   x[3]=0;
solve; 
print x[1] x[2] x[3] x[1].dual x[2].dual x[3].dual;
quit;

is this code right or am I making any mistake?

Please help

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

That is correct.  You can also do:

print x x.dual;

View solution in original post

2 REPLIES 2
Ksharp
Super User

I think you can do this.

 

proc optmodel;
var x{1..3} init 0;
min f = x[1]^2  + 2*x[2]^2 + 5*x[3]^2 - 4*x[1] - 20*x[2] - 20*x[3] ;

solve; 
print x[1] x[2] x[3] x[1].dual x[2].dual x[3].dual;
quit;
RobPratt
SAS Super FREQ

That is correct.  You can also do:

print x x.dual;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 447 views
  • 0 likes
  • 3 in conversation