hi,
I am trying to solve the following problem
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
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;
That is correct. You can also do:
print x x.dual;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.