Linear Programming: Minimizing Vertical Distance to Line

In summary, the student is asking for help with a problem they don't understand, and cannot seem to get MATLAB to do what they want it to do.
  • #1
morry
136
0
Ok, I hope this is the right section.

I have a problem that I can't even start. I have a set of points on a plane. I need to formulate a linear program so that the vertical distance between each point and a line is minimised. The line must have a positive gradient, positive y-intercept and each point must be below the line.

I have no idea what I am doing. Can anyone point me in the right direction?
Cheers.
 
Physics news on Phys.org
  • #2
Hmm, so how would I go about setting this up so I could solve it using matlab?
thanks for the help.
 
  • #3
Could I let x=[1,2,3,4,5 etc] and y=[5,4,3,2,1 etc] ie the points I am given.

Then make some function Y=mx+c? And I want to minimise Y-y.

Am I on the right track here?
 
  • #4
Enuma Elish,

While we do appreciate the work that you put into the homework help section of PF, it is nonetheless contrary to the Physics Forums Guidelines (which you agreed to) to post complete solutions to problems, or to offer assistance to students who have not shown some attempt at the problem. I have therefore soft deleted your post, and will restore it once this thread is resolved.

Helping somone with homework is great. Doing someone's homework is not OK.

Tom
 
  • #5
make some function Y=mx+c? And I want to minimise Y-y.
That's correct but incomplete.
 
  • #6
Ok, so I create that linear function, add the rest of the constraints.

What I don't understand is how to get MATLAB to find the gradient. Is it just a matter of making m a variable too?

I think I get this, but I am not quite there.

Thanks for the help again Enuma. :)
 
  • #7
Do you really need the gradient, or do you just need the derivative of the line?

If it's the second, look up finite difference approximations (Taylor series expansion with higher order terms discarded)
 
  • #8
Well, the question asks me to find the equation for the line. Its a straight line, so I suppose the derivative is the gradient.

Doing a Taylor series sounds a bit extreme, all I am asked to do it formulate a linear program.

Ill have a crack and see what I can do.

Thanks enigma.
 
  • #9
Taylor series with one term is nothing more than a secant approximation. Find two points close together. Compute rise over run. Viola. Looking up finite difference approximation methods give you some ways to do it to minimize error
 
  • #10
Hmm, ok I think I can write the problem down correctly.

But I have no idea how to solve it using matlab. The only examples of these problems are the min f(x)=x1+x2 etc with constraints x1>2 etc.

I am a retard at matlab.

Heres what I just tried:
x=[1,2,3,5,7,9]
y=[4,7,9,17,9,14]

syms X
syms Y
Y=mX+c (I have no idea how to write this equation out)
How can I put in the constraints c>0, m>0, Y>y?

Cheers.
 

What is linear programming?

Linear programming is a mathematical method used to optimize a linear objective function, subject to a set of linear constraints. It is commonly used to solve optimization problems in various fields such as economics, engineering, and management.

What is the objective of minimizing vertical distance to a line?

The objective of minimizing vertical distance to a line is to find the optimal point on a line that is closest to a given set of points. This can be useful in various applications such as finding the best fit line for a data set or determining the shortest distance between two points.

What are the steps involved in solving a linear programming problem?

The steps involved in solving a linear programming problem are:

  1. Formulating the problem as a linear program by defining the objective function and constraints
  2. Graphing the constraints to identify the feasible region
  3. Finding the coordinates of the vertices of the feasible region
  4. Evaluating the objective function at each vertex to find the optimal solution

What are the assumptions made in linear programming?

The main assumptions made in linear programming are:

  1. Linearity: The objective function and constraints must be linear
  2. Proportionality: The relationship between variables must be proportional
  3. Additivity: The total effect of all variables must be the sum of their individual effects
  4. Divisibility: Variables can take on any value within a given range
  5. Certainty: All data and parameters are known with certainty

What are the limitations of linear programming?

Some limitations of linear programming include:

  1. Linear programming can only be applied to problems with linear relationships between variables
  2. The optimal solution may not always be unique, resulting in multiple optimal solutions
  3. The assumptions made in linear programming may not always hold true in real-world situations
  4. The size and complexity of the problem can significantly impact the computational time and resources required

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
467
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
884
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
979
  • Precalculus Mathematics Homework Help
Replies
7
Views
622
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
7
Views
263
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
Back
Top