Graphing in 3D
• Purpose of 3D graphing
• Basics of 3D graphing
• Optimization in more than 1 dimension
The Purpose
So far, all the equations we’ve been dealing with
have been in two dimensions.
y Although it’s common to
think of x and y as both
being variables, in
optimization terms x is
the only variable; y is the
x
objective function.
The Purpose
But most optimization problems have more than
one variable. For example, the top speed of an
aircraft depends on a lot more than a single
variable like the length of its wing.
In the next few lessons we’ll be working with
equations in two variables, but most of the
techniques can also be applied to equations with
more than two variables.
Graphing in 3D
When there are two variables, we call them x1
and x2; the objective function would be called
f(x1, x2). Here are some objective functions with
two variables:
f(x1, x2) = x1 · x2
f(x1, x2) = (x1)2 + 2(x2)2
𝑥1 ∙𝑥2
f(x1, x2) =
1+(𝑥1 )2 +(𝑥2 )2
Graphing in 3D
The first thing to consider is the flat plane, which
is normally the axis for x and y. Now, it’s the axis
for x1 and x2.
Every single point on
x2
(0, 4)
(2, 5) this axis could be
(-2, 2) (1, 2)
plugged into f(x1, x2).
(-3, 1) (3, 1)
(-4, -1) (0, 0)
(5, -2)x
1
(-1, -2) (3, -2)
(-4, -3) (1, -3)
(0, -5) (4, -5)
Practice Problem 1
Consider this sketch of an airplane x2
wing, with variables x1 and x2
defined as the lengths indicated. x1
1. Sketch an airplane wing
x2 corresponding to each point
E
A
on the graph at left:
F
a) A b) B c) C
C D B d) D e) E f) F
x1
Practice Problem 2
Consider the two-variable function
f(x1, x2) = (x1)2 + (x2)2.
a) Evaluate this function at the points (3, 1), (-2, -
4), (0, 0), (5, -2), and (-4, 3).
b) Some points where this function has a value of
12 are (3, 3), ( 12, 0), (-2, -2 2), (1, 11),
( 3, -3) and ( 10, 2). Find at least 10 more
points, including positives and negatives as well
as square roots, and graph them all on an x1-x2
coordinate plane. Sketch the resulting shape.
Graphing in 3D
This is a picture of an Excel spreadsheet showing
the results of the function on the previous page,
f(x1, x2), between -3 and 3 in both variables:
Graphing in 3D
One type of graph is a 3D surface.
Graphing in 3D
A second type of graph is a contour map.
Here, the colors indicate different constant
values of the objective function.
Practice Problem 3
Consider the function f(x1, x2) = (x1)2 + x2.
a) Sketch a contour map with dividing lines at f
= 10, 5, 1, and 17. (To do this, find enough
points for which (x1)2 + x2 = 10 to see a
pattern, then connect those points; repeat
for 5, 1, 17.)
b) Sketch a 3D surface.