help-glpk
[Top][All Lists]

## [Help-glpk] Fwd: fraction with vars

 From: Kasper Tordrup Subject: [Help-glpk] Fwd: fraction with vars Date: Wed, 2 May 2012 19:43:27 +0200

forgot to send it to all

---------- Forwarded message ----------
From: Kasper Tordrup
Date: Wed, May 2, 2012 at 7:41 PM
Subject: Re: [Help-glpk] fraction with vars

On Wed, May 2, 2012 at 6:36 PM, Michael Hennebry wrote:
On Wed, 2 May 2012, Kasper Tordrup wrote:

After looking over Xypron's example, it became clear to me that you lack
some information, sorry for that.
The x represent a percentage of p that I need, and this means that y is <=
to w.
So summing up:
x will always be <= to p.
y will always be <= to w.
if w is 0, then so are y.
p is a constant.
x,y and w are variables.
y and w are in the range [0..6] (or close to that)
and I want to calculate:
x_suj = p_s * (y_suj/w_su)

(repeating)

if w is 0, then so are y.

x_suj * w_su = p_s * y_suj

No division issues.

(repeating)

The x represent a percentage of p that I need, and this means that y is <=
to w.

Are you sure?

I might be using the wrong words, x is NOT a percentage number (0..100 or 0..1) it is a fraction of p i.e. 2/3 or p.

Sorry for the mess, hope this clarifies it.

Actually, 'tis a bit foggier now.
What is p? Can it be 22/7, 7/22, sqrt(2.), 1/123, pi?

No, p is integer.

Is the equality exact?
Why is there a percentage involved instead of a fraction?

Sorry, x is a fraction of p.

One does not normally calculate with percentages.
Usually, percentages are just human-friendly input or output.

--
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword."  --  Lily

So, as an example p=1000, y=1 and w=3 and so I want to find x=333.3333

Does this make it a bit more clear?

--
Kasper Tordrup - Stud. M. Sc.
IMADA @ University of Southern Denmark
address@hidden - +45 27 44 58 49