Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-25-2012 03:47 AM
(1736 views)

When I write an equation in the form:

(x1+x2)/(y1+y2)=2 (where x(i), y(i) are decision variables)

SAS-OR considers the equation as a non-linear constraint.

However when I re-write the same equation in the form:

x1+x2=2*(y1+y2), SAS-OR considers it as a linear constraint.

Can somebody please help?

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

There is no auto linearization in SAS/OR yet. We do have plans to do some auto linearization in the future.

Are you using OPTMODEL or PROC NLP?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Linearization is technique to transfer nonlinear items to linear items.

Rob is right, (x1+x2) / (y1+y2) = 2 ---> x1+x2 = 2*(y1+y2), only if you know that y1+y2 is never going to be 0. Otherwise, they are not equivalent.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks for the clarification.

By the way, I have an equation of the form x/y+z=c (where x,y,z are decision variables and >0, c is a constant).Is there a possible way of converting this to a linear form?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you multiply both sides by y, you get x + y z = c y. If y and z are binary variables, you can replace the product y z with a new binary variable w and add some constraints. If only one of y and z is binary and the other is bounded, you can linearize the product in a similar manner. If neither of y and z is binary, you can discretize one of them and apply the same techniques.

For details, please see Chapters 10 and 24 in the new book of mathematical programming examples available as part of the SAS/OR documentation:

https://support.sas.com/pubscat/bookdetails.jsp?pc=64980 (click on View This Title Online for a free pdf version).

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Here is how to discretize a bounded variable y:

proc optmodel;

var y >= 0 <= 3;

num num_steps = 10;

set STEPS = 0..num_steps-1;

num a {s in STEPS} = (s - y.lb) / (y.ub - y.lb);

var yb {STEPS} binary;

con assign: sum {s in STEPS} yb~~ = 1;~~

con link: sum {s in STEPS} a~~ * yb~~~~ = y;~~

quit;

**Available on demand!**

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

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.