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

Capture1.JPG

I wrote the following code

proc optmodel;
var x{1..2} >= 0;
minimize f = x[1]^2 - 6*x[1] + x[2]^3  - 3*x[2];
con constr1: sum{i in 1..2}x[i] <= 1;

/* starting point */
x[1] = 0.5;
x[2] = 0.4;

solve with NLP;
print x;

Am I doing it right please?

 

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

Yes, that is correct.  You can do it a little more simply by omitting the starting solution and the WITH NLP clause.

View solution in original post

1 REPLY 1
RobPratt
SAS Super FREQ

Yes, that is correct.  You can do it a little more simply by omitting the starting solution and the WITH NLP clause.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 1 reply
  • 1217 views
  • 1 like
  • 2 in conversation