using MATLAB to solve a linear program

72 Views Asked by At

Hello I am very new to MATLAB and having difficulty solving a linear program problem using MATLAB, I tried solving it however I am not sure If i did it correctly

Use MATLAB to solve the following linear program problem $f = 170 x_1 + 160 x_2 , f : min $

$5x_1 + x_2 ≥ 12$

$3x_1 + 5x_2 ≥ 24$

$x_1 ≤ 5$

$x_2 ≤ 5$

$x_1, x_2 ≥ 0$ .

I tried solving it linear program

not sure if this is right, any help will be appreciated thank you

1

There are 1 best solutions below

1
On

i don't think it's necessary to use MATLAB

we have $x_2 \geq -5x+12$ and $x_2 \geq -\frac{3}{5}x_1+\frac{24}{5}$ where $0 \leq x_1, x_2 \leq 5$.

since $f = 170x_1+160x_2$, we have $x_2 = -\frac{17}{16}x_1+\frac{f}{160}$, since the slope $\frac{17}{16}$ is between $-\frac{3}{5}$ and $-5$, it's clear that the intersection of $x_2 = -5x+12$ and $x_2 = -\frac{3}{5}x_1+\frac{24}{5}$ is the answer.

the intersection is $(\frac{18}{11}, \frac{42}{11})$, so the min value of $f$ is $170 \cdot \frac{18}{11}+160 \cdot \frac{42}{11} = \frac{9780}{11}$.