Hướng Dẫn Vẽ Đồ Thị 3D trong MuPAD Của MatLab
plot::Function3d – 3D function graphs
plot::Function3d creates the 3D graph of a function in 2 variables.
Calls:
f:
|
the function: an arithmetical expression or a piecewise object in the
independent variables , and the animation parameter a. Alternatively, a MuPAD procedure that accepts 2 input parameter , or 3 input parameters , , and
returns a numerical value when the input parameters are numerical. f is equivalent to the
attribute Function.
|
x:
|
the first independent
variable: an identifier or an indexed identifier. x is equivalent to the
attribute XName.
|
.. :
|
|
y:
|
the second independent
variable: an identifier or an indexed identifier. y is equivalent to the
attribute YName.
|
.. :
|
·
The expression f(x, y) is evaluated at finitely many points , in the plot range.
There may be singularities. Although a heuristics is used to find a reasonable
range when singularities are present, it is highly recommended to specify a
range via ViewingBoxZRange = with suitable numerical real values , .
Cf. example 2.
·
Animations are triggered by
specifying a range for a parameter a
that is different from the indedependent variables x, y. Thus, in animations, the -range , the -range as well as
the animation range must be specified.
Cf. example 3.
·
The function f is evaluated on a regular equidistant mesh of sample points
determined by the attributes XMesh
and YMesh (or the shorthand-notation for both, Mesh).
By default, the attribute AdaptiveMesh = 0 is set, i.e., no adaptive refinement of the equidistant
mesh is used.
If the standard mesh does not suffice to produce a sufficiently
detailed plot, one may either increase the value of XMesh
and YMesh or set AdaptiveMesh = n with some (small) positive
integer n. This may result in up to times as many
triangles as used with AdaptiveMesh = 0, potentially more when f has non-isolated
singularities. Cf. example 4.
·
The “coordinate lines” (“parameter
lines”) are curves on the function graph.
The phrase “XLines” refers to the curves with the
parameter running
from to , while is
some fixed value from the interval .
The phrase “YLines” refers
to the curves with the parameter running from ymin to ymax, while is
some fixed value from the interval .
By default, the parameter
lines are visible. They may be “switched off” by specifying XLinesVisible = FALSE and YLinesVisible = FALSE, respectively.
·
The coordinate lines controlled by XLinesVisible = TRUE/FALSE and YLinesVisible = TRUE/FALSE indicate
the equidistant regular mesh set via the Mesh
attributes. If the mesh is refined by the Submesh attributes or by the adaptive mechanism controlled by AdaptiveMesh = n, no
additional parameter lines are drawn.
are equivalent. However, in the first setting, nx parameter lines are
visible in the direction, while in the latter setting parameter lines are visible. Cf. example 5.
adaptive sampling
|
|
influence of objects on
the ViewingBox of a scene
|
|
the main color
|
|
color of areas and
surfaces
|
|
second color of areas and
surfaces for color blends
|
|
the direction of color
transitions on surfaces
|
|
x-component of the
direction of color transitions on surfaces
|
|
y-component of the
direction of color transitions on surfaces
|
|
z-component of the
direction of color transitions on surfaces
|
|
functional area/surface
coloring
|
|
surface filling types
|
|
filled or transparent
areas and surfaces
|
|
the number of frames in
an animation
|
|
function expression or
procedure
|
|
makes a legend entry
|
|
add this object to the
legend?
|
|
short explanatory text
for legend
|
|
color of lines
|
|
color of lines
|
|
the direction of color
transitions on lines
|
|
x-component of the direction of color transitions on lines
|
|
y-component of the direction of color transitions on lines
|
|
z-component of the direction of color transitions on lines
|
|
functional line coloring
|
|
line coloring types
|
|
solid, dashed or dotted lines?
|
|
visibility of lines
|
|
width of lines
|
|
number of sample points
|
|
visibility of irregular mesh lines in 3D
|
|
the name of a plot object (for browser and legend)
|
|
initial value of the animation parameter
|
|
end value of the animation parameter
|
|
name of the animation parameter
|
|
range of the animation parameter
|
|
the size of points
|
|
the presentation style of points
|
|
visibility of mesh points
|
|
smooth color blend of surfaces
|
|
density of submesh (additional sample points)
|
|
start time of the animation
|
|
end time of the animation
|
|
the real time span of an animation
|
|
object title
|
|
horizontal alignment of titles w.r.t. their coordinates
|
|
font of object titles
|
|
position of object titles
|
|
position of object titles, x component
|
|
position of object titles, y component
|
|
position of object titles, z component
|
|
visibility
|
|
object visible after this time value
|
|
object visible after its animation time ended?
|
|
object visible until this time value
|
|
object visible before its animation time starts?
|
|
object visible during this time range
|
|
visibility of parameter lines (x lines)
|
|
final value of parameter “x”
|
|
number of sample points for parameter “x”
|
|
initial value of parameter “x”
|
|
name of parameter “x”
|
|
range of parameter “x”
|
|
density of additional sample points for parameter “x”
|
|
visibility of parameter lines (y lines)
|
|
final value of parameter “y”
|
|
number of sample points for parameter “y”
|
|
initial value of parameter “y”
|
|
name of parameter “y”
|
|
range of parameter “y”
|
|
density of additional sample points for parameter “y”
|
|
contour lines at constant z values
|
The following call returns an object representing the graph of
the function over the region , :
g := plot::Function3d(sin(x^2 +
y^2), x = -2..2, y = -2..2)
plot(g)
f := piecewise([x < y, 0],
[x >= y, (x - y)^2]):
plot(plot::Function3d(f, x = -2
.. 4, y = -1 .. 3))
f := proc(x, y)
begin
if x + y^2 + 2*y < 0 then
0
else
x + y^2 + 2*y
end_if:
end_proc:
plot(plot::Function3d(f, x = -3
.. 2, y = -2 .. 2))
delete g, f
|
We plot a function with singularities:
f := plot::Function3d(x/y +
y/x, x = -1 .. 1, y = - 1 .. 1):
plot(f)
We specify an explicit viewing range for the direction:
plot(f, ViewingBoxZRange = -20
.. 20)
delete f
|
We generate an animation of a parametrized function:
plot(plot::Function3d(sin((x -
a)^2 + y^2),
x = -2 .. 2, y = -2 ..
2, a = 0 .. 5))
|
|
The standard mesh for the numerical evaluation of a function
graph does not suffice to generate a satisfying graphics in the following
case:
plot(plot::Function3d(besselJ(0,
sqrt(x^2 + y^2)),
x = -20 .. 20, y = -20
.. 20))
We increase the number of mesh points. Here, we use XSubmesh and YSubmesh to place 2 additional
points in each direction between each pair of neighboring points of the
default mesh. This increases the runtime by a factor of :
plot(plot::Function3d(besselJ(0,
sqrt(x^2 + y^2)),
x = -20 .. 20, y = -20
.. 20,
Submesh = [2, 2]))
Alternatively, we enable adaptive sampling by setting the value
of AdaptiveMesh to some positive value:
plot(plot::Function3d(besselJ(0,
sqrt(x^2 + y^2)),
x = -20 .. 20, y = -20
.. 20,
AdaptiveMesh = 2))
|
By default, the parameter
lines of a function graph are “switched on”:
plot(plot::Function3d(x^2 + y^2, x = 0 .. 1, y = 0 .. 1))
plot(plot::Function3d(x^2 + y^2, x = 0 .. 1, y = 0 .. 1,
XLinesVisible = FALSE,
YLinesVisible = FALSE))
The number of parameter
lines are determined by the Mesh attributes:
plot(plot::Function3d(x^2 + y^2, x = 0 .. 1, y = 0 .. 1,
Mesh =
[5, 12]))
When the mesh is refined
via the Submesh attributes, the numerical approximation of the surface becomes
smoother. However, the number of parameter lines is not increased:
plot(plot::Function3d(x^2 + y^2, x = 0 .. 1, y = 0 .. 1,
Mesh =
[5, 12],
XSubmesh = 1, YSubmesh = 2))
|
Functions need not be
defined over the whole parameter range:
plot(plot::Function3d(sqrt(1-x^2-y^2), x=-1..1, y=-1..1))
plot(plot::Function3d(sqrt(sin(x)+cos(y))))
This makes for an easy
way of plotting a function over a non-rectangular area:
chi := piecewise([x^2 < abs(y), 1])
plot(plot::Function3d(chi*sin(x+cos(y))),
CameraDirection=[-1,0,0.5])
|
I am genuinely pleased to read this website posts which
ReplyDeleteconsists of tons of helpful facts, thanks for providing these
kinds of data.
my site; discipline quotes
I could not refrain from commenting. Well written!
ReplyDeleteAlso visit my web blog; commitment quotes
Wow, that's what I was exploring for, what a material! present here at this weblog, thanks admin of this web site.
ReplyDeleteFeel free to visit my homepage; best quotes ever