Skip to contentSkip to lesson map

Multivariable Functions

Status
Updates coming
Reading
MMAC Ch 1.2, pp 19-32
Lesson map

Objectives

  1. Given a multivariable function, evaluate it at a given point, by hand or in R.
  2. Given a multivariable function in tabular or graphical form, evaluate it at given points and identify whether it is increasing or decreasing with respect to each input.
  3. Given a surface or contour plot, estimate where extreme values (min/max) occur.
  4. In R, use makeFun() to define a multivariable function.
  5. In R, use plotFun() to generate a surface or contour plot for a two-input function on a specified domain.

1. Multivariable Functions

Objective. Given a multivariable function, evaluate it at a given point, by hand or in R.

Definition 1 (Multivariable function).

A multivariable function is a function with two or more inputs and only one output. A function of the two inputs xx and yy is written

f(x,y). f(x,y).

A rule that gives both the temperature and the wind speed at the map location (x,y)(x,y) is not a multivariable function, because it has two outputs and the definition allows only one. The temperature at (x,y)(x,y) alone is a multivariable function.

A point (a,b)(a,b) gives the value aa to the input xx and the value bb to the input yy. The value of ff at the point (a,b)(a,b) is f(a,b)f(a,b), found by substituting aa for every xx and bb for every yy. A point with more coordinates gives them to the inputs in the order the inputs are written: the point (a,b,c)(a,b,c) gives aa to xx, bb to yy, and cc to zz in k(x,y,z)k(x,y,z).

Example 1

Evaluate the function at (3,2)(3,2), (0,−2.1)(0,-2.1), and (−2.1,5)(-2.1,5), if possible:

f(x,y)=4x2−5yx+1. f(x,y) = 4x^2 - 5y\sqrt{x+1}.
ShowHide solution

By the definition of a multivariable function, ff has the two inputs xx and yy, and each point (x,y)(x,y) gives one output. Substitute x=3x = 3 and y=2y = 2 into the formula for ff:

f(3,2)=4(3)2−5(2)3+1=4(9)−5(2)(2)=36−20=16. f(3,2) = 4(3)^2 - 5(2)\sqrt{3+1} = 4(9) - 5(2)(2) = 36 - 20 = 16.

Substitute x=0x = 0 and y=−2.1y = -2.1:

f(0,−2.1)=4(0)2−5(−2.1)0+1=0−5(−2.1)(1)=0+10.5=10.5. f(0,-2.1) = 4(0)^2 - 5(-2.1)\sqrt{0+1} = 0 - 5(-2.1)(1) = 0 + 10.5 = 10.5.

At (−2.1,5)(-2.1,5), check the expression under the square root first:

x+1=−2.1+1=−1.1. x + 1 = -2.1 + 1 = -1.1.

The value f(−2.1,5)f(-2.1,5) is undefined, because no real number is the square root of −1.1-1.1.

Example 2

Evaluate the function at (3,8,4)(3,8,4), (1,9,−3)(1,9,-3), and (5,2,0)(5,2,0), if possible:

k(x,y,z)=2x−yz. k(x,y,z) = 2x - \frac{y}{z}.
ShowHide solution

Substituting each point into the formula gives

k(3,8,4)=2(3)−84=6−2=4, k(3,8,4) = 2(3) - \frac{8}{4} = 6 - 2 = 4,
k(1,9,−3)=2(1)−9−3=2+3=5. k(1,9,-3) = 2(1) - \frac{9}{-3} = 2 + 3 = 5.

The value k(5,2,0)k(5,2,0) is undefined, because z=0z = 0 makes yz\tfrac{y}{z} a division by zero.

Example 8 in section 4 evaluates ff and kk at these points in R.

Lesson map

2. Tables and Graphs

Objective. Given a multivariable function in tabular or graphical form, evaluate it at given points and identify whether it is increasing or decreasing with respect to each input.

Tabular form. A table of a two-input function lists the values of one input across the top row and the values of the other input down the left column. The corner cell names both inputs. In the corner cell V\TV \backslash T of the table in Example 3, the input VV left of the backslash labels the rows, and the input TT right of the backslash labels the columns. The output at a point sits in the cell where the point’s row and column cross.

Definition 2 (Increasing and decreasing with respect to an input).

Increasing with respect to an input means that, on an interval of one input, the output always gets larger as that input increases while every other input is held constant at a given value.

Decreasing with respect to an input means that, on an interval of one input, the output always gets smaller as that input increases while every other input is held constant at a given value.

With every other input held constant, the output depends on one input alone, as for a function of one input.

A ball thrown straight up at vv meters per second has height

H(t,v)=vt−4.9t2 H(t,v) = vt - 4.9t^2

meters tt seconds after release. With v=19.6v = 19.6, the function HH is neither increasing nor decreasing with respect to tt on 0≤t≤40 \le t \le 4, because the output neither always gets larger nor always gets smaller on that interval. The output rises from H(0,19.6)=0H(0,19.6) = 0 to H(2,19.6)=19.6H(2,19.6) = 19.6 and falls back to H(4,19.6)=0H(4,19.6) = 0.

Example 3

The table gives WC(T,V)WC(T,V), the wind chill (∘^\circF) at air temperature TT (∘^\circF) and wind speed VV (mph).

V\TV \backslash T−10-1000101020203030
55−22-22−11-111113132525
1010−28-28−16-16−4-4992121
2020−35-35−22-22−9-9441717
3030−39-39−26-26−12-12111515
4040−43-43−29-29−15-15−1-11313

Find WC(10,20)WC(10,20) and WC(30,10)WC(30,10). Then, over the inputs in the table, determine whether WCWC is increasing or decreasing with respect to TT when V=20V = 20, and with respect to VV when T=0T = 0.

ShowHide solution

Read the temperature TT from the top row and the wind speed VV from the left column. The column T=10T = 10 and the row V=20V = 20 give WC(10,20)=−9WC(10,20) = -9. The column T=30T = 30 and the row V=10V = 10 give WC(30,10)=21WC(30,10) = 21.

By the definition of increasing with respect to an input, hold V=20V = 20 constant and read the outputs as TT increases. The function WCWC is increasing with respect to TT when V=20V = 20, because the row V=20V = 20 runs −35,−22,−9,4,17-35, -22, -9, 4, 17 as TT increases. Hold T=0T = 0 constant and read down its column. The function WCWC is decreasing with respect to VV when T=0T = 0, because the column T=0T = 0 runs −11,−16,−22,−26,−29-11, -16, -22, -26, -29 as VV increases.

Each graph plots the output against one input with the other input held constant. The first two graphs plot the wind chill WC(T,V)WC(T,V) (∘^\circF) at air temperature TT (∘^\circF) and wind speed VV (mph). Their points are the cells of the row V=5V = 5 and the column T=30T = 30 of the table in Example 3.

Increasing

Figure

With the wind speed held at 5 mph, the wind chill rises from −22-22 to 25 ∘25\,^\circF as the temperature rises from −10-10 to 30 ∘30\,^\circF.

Decreasing

Figure

With the temperature held at 30 ∘30\,^\circF, the wind chill falls from 25 to 13 ∘13\,^\circF as the wind speed rises from 5 to 40 mph.

Neither

Figure

With the throwing speed vv held at 19.6 meters per second, the ball rises for 2 seconds and then falls for 2 seconds.

Figure
Figure

The figure shows two graphs of s(x,y)=x2+y2s(x,y) = x^2 + y^2. The left graph is its surface plot: each output is a height above its point (x,y)(x,y). The points of the surface at height 4 form the solid orange circle at the rim. Directly below that circle, the dashed circle x2+y2=4x^2 + y^2 = 4 in the xyxy-plane contains every point where s(x,y)=4s(x,y) = 4, the level 4 contour. The right graph is the contour plot, with that contour in orange among the contours at levels 1, 2, and 3.

Definition 3 (Surface plot).

A surface plot is a three-dimensional graph where the value of each f(x,y)f(x,y) is plotted as a height z=f(x,y)z = f(x,y) measured relative to the zz-axis above or below the corresponding point (x,y)(x,y) on the xyxy-plane.

Definition 4 (Contour).

A contour of f(x,y)f(x,y) at level CC is a curve in the xyxy-plane containing all points where f(x,y)=Cf(x,y) = C. A contour is also called a level curve.

For s(x,y)=x2+y2s(x,y) = x^2 + y^2, the line y=xy = x is not a contour, because the outputs on it differ: s(1,1)=2s(1,1) = 2 and s(2,2)=8s(2,2) = 8. Every point of a contour at level CC has the output CC.

Definition 5 (Contour plot).

A contour plot is a two-dimensional graph in the xyxy-plane of contours of f(x,y)f(x,y) at various levels.

The left graph in the figure of s(x,y)=x2+y2s(x,y) = x^2 + y^2 is not a contour plot, because it is three-dimensional, and the definition requires a two-dimensional graph in the xyxy-plane. The right graph is not a surface plot, because it shows each output as the level of a contour instead of as a height z=f(x,y)z = f(x,y).

The plotted domain is the rectangle of inputs (x,y)(x,y) that a surface plot or contour plot covers, such as −3≤x≤3-3 \le x \le 3, −3≤y≤3-3 \le y \le 3.

Outputs on a contour plot. As in the textbook, every function plotted in these Notes is continuous on the plotted domain. Two contours are adjacent along a straight path when the path meets no other contour between them. On every contour plot in these Notes, the contours lie close enough together that, between two adjacent contours of different levels, the output only rises or only falls. Read an output from the plot by these rules:

  1. At a point on a contour, the output is that contour’s level.
  2. At a point between two adjacent contours of different levels, the output lies between their two levels.
  3. For a contour without a label on a plot with evenly spaced levels, find the level spacing, the difference between the levels of two adjacent labeled contours. Then count the contours out from a labeled contour, one level spacing per contour.

On a contour plot, xx increases straight to the right and yy increases straight up. The function is increasing with respect to xx when the contours along a path straight to the right rise in level, and decreasing with respect to xx when they fall in level. The function is increasing with respect to yy when the contours along a path straight up rise in level, and decreasing with respect to yy when they fall in level.

Example 4

The figure is the contour plot of g(x,y)g(x,y) on −3≤x≤3-3 \le x \le 3, −3≤y≤3-3 \le y \le 3, with contours at levels −2-2 to 3. Estimate g(0,1)g(0,1), g(−2,0)g(-2,0), and g(2,−1)g(2,-1). Then determine whether gg is increasing or decreasing with respect to xx on 0≤x≤0.70 \le x \le 0.7 when y=−1y = -1, and with respect to yy on 2≤y≤2.72 \le y \le 2.7 when x=2x = 2.

ShowHide solution

By the definitions of a contour plot and a contour, the figure shows contours of gg at levels −2-2 to 3, and every point on the level 2 contour has output 2. The value g(0,1)g(0,1) is approximately 2, because (0,1)(0,1) is on the level 2 contour. Likewise, g(−2,0)g(-2,0) is approximately −1-1, because (−2,0)(-2,0) is on the level −1-1 contour. The value g(2,−1)g(2,-1) is between 0 and 1, because (2,−1)(2,-1) is between the level 0 contour and the level 1 contour. The three points are the black dots in the figure.

The function gg is increasing with respect to xx on 0≤x≤0.70 \le x \le 0.7 when y=−1y = -1, because the green path straight right from (0,−1)(0,-1) starts between the level −1-1 and level 0 contours and crosses the level 0 contour toward higher levels. The function gg is decreasing with respect to yy on 2≤y≤2.72 \le y \le 2.7 when x=2x = 2, because the purple path straight up from (2,2)(2,2) starts between the level 2 and level 1 contours and crosses the level 1 contour toward lower levels.

Figure

Lesson map

3. Extreme Values

Objective. Given a surface or contour plot, estimate where extreme values (min/max) occur.

Definition 6 (Extreme values).

The extreme values are the maximum and minimum values of the function.

The global maximum of f(x,y)f(x,y) on a plotted domain is the numeric value f(a,b)f(a,b) for a point (a,b)(a,b) in the plotted domain such that f(a,b)≥f(x,y)f(a,b) \ge f(x,y) for all (x,y)(x,y) in the plotted domain.

The global minimum of f(x,y)f(x,y) on a plotted domain is the numeric value f(a,b)f(a,b) for a point (a,b)(a,b) in the plotted domain such that f(a,b)≤f(x,y)f(a,b) \le f(x,y) for all (x,y)(x,y) in the plotted domain.

On the plotted domain 0≤x≤30 \le x \le 3, 0≤y≤30 \le y \le 3, the value r(3,0)=3r(3,0) = 3 of r(x,y)=x+yr(x,y) = x + y is not the global maximum, because r(3,3)=6r(3,3) = 6 is larger. The definition requires f(a,b)≥f(x,y)f(a,b) \ge f(x,y) for every point (x,y)(x,y) in the plotted domain.

On a surface plot, the global maximum is the height of the highest point of the surface, and the global minimum is the height of the lowest point.

A peak is a point whose output is at least every output near it, and that output is a local maximum. A basin is a point whose output is at most every output near it, and that output is a local minimum. These are the two-input forms of the one-input definitions in section 3 of the Lesson 28 Notes. A global maximum at a peak inside the plotted domain is also a local maximum, and a global minimum at a basin inside the plotted domain is also a local minimum.

On a contour plot, an extreme value occurs in one of two places.

Extreme value inside the plotted domain

Figure

A global maximum inside the plotted domain occurs at a peak, inside an innermost contour of the highest level, with an output above that level. The height h(x,y)=9−x2−y2h(x,y) = 9 - x^2 - y^2 in meters of a hill has its global maximum h(0,0)=9h(0,0) = 9 inside the level 8 contour: the summit is 9 meters high. A global minimum inside the plotted domain occurs at a basin, inside an innermost contour of the lowest level, with an output below that level.

Extreme value on the edge of the plotted domain

Figure

When the outputs keep rising toward an edge of the plotted domain and no peak inside reaches higher, the global maximum occurs on that edge. The height r(x,y)=x+yr(x,y) = x + y in meters of a ramp rises toward the corner (3,3)(3,3), and its global maximum is r(3,3)=6r(3,3) = 6: the top of the ramp is 6 meters high. When the outputs keep falling toward an edge and no basin inside reaches lower, the global minimum occurs on that edge.

Example 5

The figures are the surface plot and the contour plot of g(x,y)g(x,y) on −3≤x≤3-3 \le x \le 3, −3≤y≤3-3 \le y \le 3, with contours at levels −2-2 to 3. Estimate the global maximum and the global minimum of gg on this plotted domain, and where each occurs.

Figure
Figure
ShowHide solution

By the definition of extreme values, the global maximum is the output g(a,b)g(a,b) that is at least every other output on the plotted domain. By the definition of a surface plot, each output is a height. The highest point of the surface is near (1,1)(1,1), and the innermost contour of the highest level is the level 3 contour, centered near (1,1)(1,1). The global maximum is therefore above 3, at approximately (1,1)(1,1).

The lowest point of the surface is near (−1.5,−1)(-1.5,-1), and the innermost contour of the lowest level is the level −2-2 contour, centered near (−1.5,−1)(-1.5,-1). As a result, the global minimum is below −2-2, at approximately (−1.5,−1)(-1.5,-1).

Example 6

The figure is the contour plot of

p(x,y)=x2+xy+y2−3x p(x,y) = x^2 + xy + y^2 - 3x

on −5≤x≤5-5 \le x \le 5, −5≤y≤5-5 \le y \le 5, with contours at levels 5, 20, 50, and 80. Estimate the global minimum and the global maximum of pp on this plotted domain, and where each occurs. Then determine where pp is increasing and where it is decreasing with respect to xx when y=1y = 1, as xx runs from −5-5 to 5.

Figure
ShowHide solution

The innermost contour of the lowest level is the level 5 contour, centered near (2,−1)(2,-1). The global minimum is below 5 at approximately (2,−1)(2,-1). Substitute x=2x = 2 and y=−1y = -1 into the formula for pp to estimate the global minimum:

p(2,−1)=22+2(−1)+(−1)2−3(2)=4−2+1−6=−3. p(2,-1) = 2^2 + 2(-1) + (-1)^2 - 3(2) = 4 - 2 + 1 - 6 = -3.

The global minimum is approximately −3-3.

The level 80 contour appears only near the lower-left corner (−5,−5)(-5,-5). The global maximum on the plotted domain occurs at that corner, because the outputs keep rising past the level 80 contour toward it. Substitute x=−5x = -5 and y=−5y = -5 to find the global maximum:

p(−5,−5)=(−5)2+(−5)(−5)+(−5)2−3(−5)=25+25+25+15=90.\begin{align*} p(-5,-5) &= (-5)^2 + (-5)(-5) + (-5)^2 - 3(-5)\\ &= 25 + 25 + 25 + 15 = 90. \end{align*}

The global maximum is 90, at the corner (−5,−5)(-5,-5).

The orange line y=1y = 1 runs from x=−5x = -5 across the level 20 contour and then the level 5 contour, and later crosses the level 5 contour a second time. With y=1y = 1 held constant, the function pp is first decreasing and then increasing with respect to xx. Substitute y=1y = 1 into the formula to find where the change from decreasing to increasing happens:

p(x,1)=x2+x(1)+12−3x=x2−2x+1=(x−1)2. p(x,1) = x^2 + x(1) + 1^2 - 3x = x^2 - 2x + 1 = (x - 1)^2.

The square (x−1)2(x - 1)^2 is smallest at x=1x = 1. When y=1y = 1, the function pp is decreasing with respect to xx on −5≤x≤1-5 \le x \le 1 and increasing with respect to xx on 1≤x≤51 \le x \le 5.

Lesson map

4. Defining a Multivariable Function in R

Objective. In R, use makeFun() to define a multivariable function.

To define a multivariable function, list every input after the tilde, joined by &. To evaluate the function, give a value for each input:

name = makeFun(formula ~ x & y & z)

name(x = 3, y = 4, z = 5)

Unnamed values in a call go to the inputs in the order written after the tilde. Named values, as in name(z = 5, y = 4, x = 3), go to the named inputs, whatever their order.

Example 7

Define the function in R and evaluate it at (3,4,5)(3,4,5) and (1.813,−4.267,5.1)(1.813,-4.267,5.1):

m(x,y,z)=x2+7y−z. m(x,y,z) = x^2 + 7y - z.
ShowHide solution

Define mm with makeFun() and all three inputs after the tilde. Evaluate it at (3,4,5)(3,4,5) three ways (named inputs, named inputs in another order, and unnamed inputs) and then at the second point. Used R.

m = makeFun(x^2 + 7*y - z ~ x & y & z)
m(x = 3, y = 4, z = 5)
[1] 32
m(z = 5, y = 4, x = 3)
[1] 32
m(3, 4, 5)
[1] 32
m(x = 1.813, y = -4.267, z = 5.1)
[1] -31.68203

R gives m(3,4,5)=32m(3,4,5) = 32 all three ways and m(1.813,−4.267,5.1)≈−31.682m(1.813,-4.267,5.1) \approx -31.682.

Example 8

Evaluate each function in R at the points given:

f(x,y)=4x2−5yx+1at (3,2), (0,−2.1), (−2.1,5), f(x,y) = 4x^2 - 5y\sqrt{x+1} \quad \text{at } (3,2),\ (0,-2.1),\ (-2.1,5),
k(x,y,z)=2x−yzat (3,8,4), (1,9,−3), (5,2,0), (4,0,0). k(x,y,z) = 2x - \frac{y}{z} \quad \text{at } (3,8,4),\ (1,9,-3),\ (5,2,0),\ (4,0,0).
ShowHide solution

Define ff and kk with makeFun() as in Example 7, and evaluate each at its points. Used R.

f = makeFun(4*x^2 - 5*y*sqrt(x + 1) ~ x & y)
f(x = 3, y = 2)
[1] 16
f(x = 0, y = -2.1)
[1] 10.5
f(x = -2.1, y = 5)
[1] NaN
Warning message:
In sqrt(x + 1) : NaNs produced
k = makeFun(2*x - y/z ~ x & y & z)
k(x = 3, y = 8, z = 4)
[1] 4
k(x = 1, y = 9, z = -3)
[1] 5
k(x = 5, y = 2, z = 0)
[1] -Inf
k(x = 4, y = 0, z = 0)
[1] NaN

R gives f(3,2)=16f(3,2) = 16, f(0,−2.1)=10.5f(0,-2.1) = 10.5, k(3,8,4)=4k(3,8,4) = 4, and k(1,9,−3)=5k(1,9,-3) = 5, the values Examples 1 and 2 find by hand. R returns NaN or -Inf in place of a number at the three points where a function is undefined, as it does for one input (Lesson 2 Notes, section 5).

Lesson map

5. Plotting a Function of Two Inputs

Objective. In R, use plotFun() to generate a surface or contour plot for a two-input function on a specified domain.

To plot a function of two inputs, give the formula, both inputs after the tilde, and the plotted domain:

plotFun(f(x,y) ~ x & y, xlim = range(-5, 5), ylim = range(-5, 5))

The formula ends in ~ x & y, which names both inputs. Without that ending, R stops before drawing:

> plotFun(f(x,y), xlim = range(-5, 5), ylim = range(-5, 5))
Error: object 'x' not found

The options xlim and ylim set the plotted domain, here −5≤x≤5-5 \le x \le 5 and −5≤y≤5-5 \le y \le 5, and the axes of the plot end at those values. To read the plotted domain from a finished plot, use the axis ends, which can lie past the last labeled tick mark.

By default, the command plotFun draws a shaded contour plot. Three options change the plot:

  • with surface = TRUE, plotFun draws a surface plot in place of the contour plot;
  • with filled = FALSE, plotFun draws the contours without shading;
  • with levels = c(5, 20, 50), plotFun draws the contours at those levels only.

Example 9

Define the function in R and evaluate it at (−1,1)(-1,1), (1,1)(1,1), and (0,3)(0,3):

p(x,y)=x2+xy+y2−3x. p(x,y) = x^2 + xy + y^2 - 3x.

Then draw its surface plot and an unshaded contour plot at levels −3-3, 5, 20, 50, and 80, both on the plotted domain −5≤x≤5-5 \le x \le 5, −5≤y≤5-5 \le y \le 5. The figure is the unshaded contour plot.

Figure
ShowHide solution

Define pp with makeFun() and evaluate it at the three points. Used R.

p = makeFun(x^2 + x*y + y^2 - 3*x ~ x & y)
p(-1, 1)
[1] 4
p(1, 1)
[1] 0
p(0, 3)
[1] 9

R gives p(−1,1)=4p(-1,1) = 4, p(1,1)=0p(1,1) = 0, and p(0,3)=9p(0,3) = 9. On the contour plot, the points (−1,1)(-1,1) and (1,1)(1,1) lie inside the level 5 contour, where the outputs are below 5. The point (0,3)(0,3) lies between the level 5 and level 20 contours, and its output 9 lies between 5 and 20. Draw the surface plot, and then the unshaded contour plot at the five levels, on the plotted domain. Used R.

plotFun(p(x,y) ~ x & y, surface = TRUE,
xlim = range(-5, 5), ylim = range(-5, 5))
plotFun(p(x,y) ~ x & y, filled = FALSE,
xlim = range(-5, 5), ylim = range(-5, 5),
levels = c(-3, 5, 20, 50, 80))

R draws no level −3-3 contour, for the reason stated after this example.

Missing levels. The command plotFun draws a contour only at a level that the function reaches at more than one point of the plotted domain. In Example 9, plotFun draws no level −3-3 contour, because pp reaches −3-3 only at the point (2,−1)(2,-1). Completing the square gives

p(x,y)=(x−2+y+12)2+34(y+1)2−3. p(x,y) = \left(x - 2 + \frac{y + 1}{2}\right)^2 + \frac{3}{4}(y + 1)^2 - 3.

Both squares are 0 only when y=−1y = -1 and x=2x = 2, and every other point gives p(x,y)>−3p(x,y) > -3. On the plotted domain −2≤x≤2-2 \le x \le 2, −2≤y≤2-2 \le y \le 2, plotFun draws no level 20, 50, or 80 contour, because the largest output there is p(−2,−2)=18p(-2,-2) = 18. That output sits at the lower-left corner, toward which the outputs rise in the figure of Example 9.

Example 10

The National Weather Service models the wind chill WCWC (∘^\circF) at air temperature TT (∘^\circF) and wind speed VV (mph), for T≤50T \le 50 and V≥3V \ge 3, by

WC(T,V)=35.74+0.6215T−35.75V0.16+0.4275TV0.16. WC(T,V) = 35.74 + 0.6215T - 35.75V^{0.16} + 0.4275TV^{0.16}.

Define WCWC in R and evaluate WC(10,20)WC(10,20). Then draw an unshaded contour plot of WCWC on the plotted domain −10≤T≤30-10 \le T \le 30, 5≤V≤405 \le V \le 40, with contours at levels −40-40, −30-30, −20-20, −10-10, 0, 10, and 20.

ShowHide solution

Define WCWC with makeFun(), listing TT and VV after the tilde, and evaluate it at (10,20)(10,20). Used R.

WC = makeFun(35.74 + 0.6215*T - 35.75*V^0.16 +
0.4275*T*V^0.16 ~ T & V)
WC(T = 10, V = 20)
[1] -8.876221

R gives WC(10,20)≈−8.876WC(10,20) \approx -8.876. Rounded to a whole degree, the value is the −9-9 in the column T=10T = 10 and the row V=20V = 20 of the table in Example 3. Draw the contour plot on the plotted domain at the seven levels. With TT first after the tilde, R puts TT on the horizontal axis. The option xlim then sets the range of TT, and ylim sets the range of VV. Used R.

plotFun(WC(T,V) ~ T & V, filled = FALSE,
xlim = range(-10, 30), ylim = range(5, 40),
levels = c(-40, -30, -20, -10, 0, 10, 20))

R labels each contour with its level, as in the figure. The point (10,20)(10,20) lies between the level −10-10 and level 0 contours, and its output −8.876-8.876 lies between −10-10 and 0. The function WCWC is increasing with respect to TT, because the contours along each path straight right rise in level.

Figure

Lesson map

Found a mistake, a broken tool or something unclear? Report a problem