How to represent 2D lines (i.e. on $x$ and $y-axis$) on a 3D graph using either Cartesian ($z=f(x,y)$) or Parametric $(x,y,z)=f(u,v)$

110 Views Asked by At

How to represent 2D lines (i.e. on $x$ and $y-axis$) on a 3D graph using either Cartesian ($z=f(x,y)$) or Parametric $(x,y,z)=f(u,v)$

Hi, I've been working on a Simplex problem and would like to include a 3D graphical check where I graph the objective function ($z=9x+7y$) along with constraints (e.g. $10a+5b<=50$, etc.) like the graph on page 2 of this pdf (so that I can visually confirm the solution as the highest point of the graph (in the z-direction): https://www.cs.duke.edu/courses/spring09/cps111/notes/LP.pdf However on the graphing software I have used so far, I can graph the objective function but I have to somehow represent the constraints in either Cartesian ($z=f(x,y)$) or Parametric $(x,y,z)=f(u,v)$ form and although I have attempted to learn how this works, every time I try to enter the constraints, they don't appear with the 3D graph.

This is my objective function graphed on the software I'm using (TeraPlot LT): https://i.stack.imgur.com/Wll1c.jpg

Any help or insight on how to represent 2D functions on a 3D plane or recommended free software that allows the user to enter $f(x,y)$ and $f(x)$ functions would be much appreciated. Thanks!

1

There are 1 best solutions below

0
On

Suppose you have the following LP-program:

$\texttt{max} \ x+y$

$0.4x+2y\leq 26$

$2x+y \leq 40$

$2y \leq 24$

$x,y \geq 0$

Solving the constraints for $y$

$y \leq 13-0.2x \ \text{(red line)}$

$y \leq 40-2x \ \text{(green line)}$

The green line is part of the bound of the permissible region from point $(15/10)$ to point $(20/0)$

$y \leq 12 \ \text{(grey line)}$

Now you can draw the inequalities in the coordinate system. Because of $x,y \geq 0$ only the first quadrant has to be considered. All constraints are $\leq$ inequalities. Therefore y has to be smaller or equal to the RHS. The green area represents the permissible region.

The blue lines represent different leves ($z$) of the objective function. First the objective function is solved for $y$.

$z=x+y \Rightarrow y=z\color{red}{-1}x$

enter image description here

The crucial point is the slope of the line, which is $-1$. At $z=0$ the line goes through the origin. At z=5 the line goes from $(0/5)$ to $(5/0)$. The line of the objective function has to be shifted towards the limit of the permissible region. In this case it is the point $(15/10)$.