Functions of Several Variables...ans = Sketching functions of two variables A single variable...
Transcript of Functions of Several Variables...ans = Sketching functions of two variables A single variable...
![Page 1: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/1.jpg)
Functions of Several Variables
DefinitionFunctions of several variables take more than one independent variable as input and uniquely map them to adependent variable such as .
syms x y z t u v wf=x^4-2*y^2*x^2+y^4
f =
g=u^2*v+v^3+4*u*v*w
g =
h=x*y+3*z^2*y+t
h =
The value of a multi-variable function
is the value of the function when values are substituted for the
independent variables . For example in the above functions, we have
subs(f,[x y],[1 0])
ans =
subs(g,[u v w],[1 2 3])
ans =
subs(h,[x y z t],[-1 3 0 1])
1
![Page 2: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/2.jpg)
ans =
Sketching functions of two variablesA single variable functions can be visualized by plotting the graph of f in the -plane. For
example, if we substitute and in the above function g, its v-dependence can be plotted as
ezplot(subs(g,[u w],[1 1]))ylabel('g')
Similarly, there are two ways to visualize two-variable functions :
i) the surface in -space, ii) contour curves constant in the -plane asdepicted for the function f.
ezsurf(f)
2
![Page 3: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/3.jpg)
ezcontour(f)
3
![Page 4: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/4.jpg)
Planes and quadratic surfaces
Below, you see a number of well-known surfaces and command lines to plot them in MATLAB. Note thatin all quadratic cases below, the z-axis is the axis of symmetry. As an exercise, you can regenerate theequations and corresponding graphs with either the x-axis or they-axis as the axis of symmetry. You can alsochange the parameters for each type of surface and check the diversity of the shapes produced.
Plane:
The equation of a plane equation is as discussed previously where is the vector
normal to the plane. For example, for , , , , we have
ezsurf(1-3*x-y)
Cylinder:
The cylinder equation is where r is the base radius and the z-axis is axis of symmetry. For the
case of unit radius, we have .
4
![Page 5: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/5.jpg)
cylinder
To find out how to plot more general cylinders, use
help cylinder
cylinder Generate cylinder. [X,Y,Z] = cylinder(R,N) forms the unit cylinder based on the generator curve in the vector R. Vector R contains the radius at equally spaced points along the unit height of the cylinder. The cylinder has N points around the circumference. SURF(X,Y,Z) displays the cylinder. [X,Y,Z] = cylinder(R), and [X,Y,Z] = cylinder default to N = 20 and R = [1 1]. Omitting output arguments causes the cylinder to be displayed with a SURF command and no outputs to be returned. cylinder(AX,...) plots into AX instead of GCA. See also sphere, ellipsoid.
Reference page for cylinder
Elliptic cone:
5
![Page 6: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/6.jpg)
The elliptic cone equation is in general and for a cone with a circular base and vertex
angle, we have .
ezsurf(-sqrt(x^2+y^2));hold onezsurf(sqrt(x^2+y^2));zlim([-5,5]);hold off
Elliptic paraboloid:
The elliptic paraboloid equation is in general and for the specific case of a circular
paraboloid we have .
ezsurf(x^2+y^2)
6
![Page 7: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/7.jpg)
Sphere:
The sphere equation is where r is the sphere radius. For the case of unit radius, we
have .
ezsurf(-sqrt(1-x^2-y^2));hold onezsurf(sqrt(1-x^2-y^2));zlim([-1,1]);hold off;pbaspect([1 1 1])
7
![Page 8: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/8.jpg)
Ellipsoid:
The ellipsoid equation is where are diameters of crosssectional ellipses
in directions, respectively.
ezsurf(-sqrt(1-x^2/4-y^2));pbaspect([2 1 1]);hold onezsurf(sqrt(1-x^2/4-y^2));zlim([-1,1]);hold off
8
![Page 9: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/9.jpg)
Hyperbolic paraboloid:
The hyperbolic paraboloid equation is with two parabolic intersections
in and planes and hyperbolic intersections in planes.
ezsurf(x^2-y^2)
9
![Page 10: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/10.jpg)
Hyperboloid of one sheet:
The equation of hyperboloid of one sheet is with two hyperbolic intersections
in and planes and an elliptic intersection in plane. As the name tells, z can cover all realvalues resulting in a one-sheet surface.
ezsurf(-sqrt(x^2+y^2-1));hold onezsurf(sqrt(x^2+y^2-1));hold off;zlim([-5,5])
10
![Page 11: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/11.jpg)
Hyperboloid of two sheets:
The equation of hyperboloid of two sheets is with two hyperbolic intersections
in and planes and elliptic intersections in planes where or resulting in atwo-sheet surface.
ezsurf(-sqrt(x^2+y^2+1))hold onezsurf(sqrt(x^2+y^2+1))zlim([-5,5])
11
![Page 12: Functions of Several Variables...ans = Sketching functions of two variables A single variable functions can be visualized by plotting the graph of f in the -plane. For example, if](https://reader030.fdocuments.net/reader030/viewer/2022040108/5f039b0b7e708231d409e10f/html5/thumbnails/12.jpg)
12