View Full Version : Linear programming?
Dr-NiKoN
Nov4-04, 10:11 AM
2 train-lines leave the same central station at the same time.
line 1: f(x) = 6000 + 50x
line 2: g(y) = 2000 + 50y
x and y are the number of departures pr. hour. line 1 can have 2 departures pr. hour pr. trian, and line 2 can only have 1 departure pr. hour pr. train.
There is a total of 100 trains.
I'm supposed to show this graphically.
I have:
x + y \geq 100
Since line 1 can have 2 departures pr. hour. pr. train, I also have:
f(x) = 6000 + 50(2)x
But, I'm confused on how I show this graphically? What do I need to plot here?
Plotting f(x) and g(y) doesn't make any sense at all.
Are you sure you don't want x+y \leq 100?
Are you sure that the equations are really what you represent them as in general - It seems like f(x) and g(y) might be the number of people each train handles, with x and y the number of departues of that type of train.
So, let's say that t_1 and t_2 are the numbers of each type of train. Then you have:
t_1+t_2 \leq 100 - The number of trains is limited
t_1\geq 0 - It's impossibe to have fewer than 0 trains
t_2\geq 0
The feasible region should be a triangle, with two sides along the axes.
And I'll guess that you're going to maximize
p=f(x)+g(y)=6000+50 t_1 + 2000 + 2 (50) t_2=8000+50t_1+100t_2
Dr-NiKoN
Nov4-04, 11:05 AM
Ah, that helps. I'll see what I come up with this.
thanks alot :)
Dr-NiKoN
Nov4-04, 03:20 PM
Hm, I misunderstood.
Each train can hold 150 passagers. You need to show graphically which combinations of x and y that can handle all the passengers that wants to take the train.
The amount of passengers that wants to take the train are given by f(x) and g(x).
So, this amounts to:
f(x) = \frac{6000 + 100x}{150} (There are 2 departures for each departure in g(x).)
g(x) = \frac{2000 + 50x}{150}
Wouldn't this be correct? I'm not sure how the unequalities would look like though.
x + y \leq 100
40 + \frac{1}{1.5}x \geq ?
\frac{20}{1.5} + \frac{10}{3}x \geq ?
I'm sorry, but I can't really follow your last post.
Let's say, for a moment that the number of people that want to ride train t_x is
f(x)=6000+100x where x is the number of trains, then, in order for the trains to meet the demand the number of people that can ride the trains must be larger than the demand:
2 \times 150 \times x
is the number of people that train route t_x can handle per hour based on two departures per train per hour. An that must be larger than the number of people that want to ride trains on that route so
2\times 150 \times x \geq f(x)=6000+100x
300 \times x \geq 6000 + 100x
x \geq 30
The inital stuff might not be set up right, so you'll have to check it out. You'll do a similar thing for y, and then the x+y \leq 100 condition.
Dr-NiKoN
Nov4-04, 04:31 PM
Ah, yes, this makes sense. Thanks :)
Now I've stumbled upon another problem, which probably isn't to related to this forum. I'll ask anyway.
How do I plot this with gnuplot?
I have:
x + y \leq 100
x \leq 24
y \leq 20
I can plot the first and the last with:
plot 100 - x, 20
But, how do i plot x = 24?
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.