1. May 8, 2004

### angel

hi,

Just wondering if anyone knows how to do Quadratic Programming, i'm attempting some questions but im confused.
So any one know how to do it?

2. May 8, 2004

3. May 8, 2004

### angel

an example is provided below which will help u understand it:

a shop produces two types of sweet machines A and B. it costs the shop £40 to make each machine A and £70 to make each machine of B.

from research it is suggested that that if the selling price of A and B are set as F and P then they will sell X of A and Y of B and the relationships are given by:
F=£220-3x and P=£250-2Y

Now how would u formulate this problem, the answer u should get is:

-3x^2-2y^2+180X+180Y

4. May 8, 2004

### Gokul43201

Staff Emeritus
What you want to do (assuming reasonable human behavior) is maximize the profit, Pr.
If x of A are produced, and y of B, then the profit is the total selling price, TSP, minus the total cost price, TCP.

Pr = TSP - TCP = TSP(A) - TCP(A) + TSP(B) - TCP(B)
= xF - 40x + yP - 70y, where F and P are as described.

Substituting for F, P, you get

Pr = x(220 - 3x) - 40x +y(250 - 2y) -70y
= 220x - 3x^2 -40x + 250y -2y^2 -70y
= 180x - 3x^2 +180y - 2y^2

That's how you formulate the profit function, which you now want to maximize. The formulation is done the same way as for a LP problem. The difference appears in the function you are optimizing, which is now a quadratic in the variables.

5. May 8, 2004

### angel

thanks alot for that.