chapter 10: graphics matlab for scientist and engineers using symbolic toolbox
TRANSCRIPT
2
You are going to Review the basics of plotting simple 2-D/3-D
graphs and animations Create graphs with different attributes Generate advanced animated graphs with
timing control Handle cameras for static and animated 3-D
graphs
3
Introduction
Graphics – Tool for exploring math objects MuPAD: Easy 2-D, 3-D and animated graphs Interactive graph attributes editor Plot library does it all
20
Anatomy of Complex 2D Graph
Function and its tangential line at a point
plot::Point2dplot::Line2d
plot::Function2d
23
Example: Interpolated Curve
Original curve and its sampled points
Interpolated points using cubic spline
Both curves and sampled points
25
Example: Cycloids A cycloid is the curve that you get when following a point
fixed to a wheel rolling along a straight line. We visualize this construction by an animation in which we use the x coordinate of the hub as the animation parameter. The wheel is realized as a circle. There are 3 points fixed to the wheel: a green point on the rim, a blue point inside the wheel and a red point outside the wheel:
source code can be found in 'ch10_graphics_demo.mn'
26
Example: ODE Vector Field We wish to visualize the solution of the ordinary differential equation
(ODE) y′(x) = −y(x)3 + cos(x) with the initial condition y(0) = 0. The so-lution shall be drawn together with the vector field v⃗ (x, y) = (1,−y3 + cos(x)) associated with this ODE (along the solution curve, the vec-tors of this field are tangents of the curve).
source code can be found in 'ch10_graphics_demo.mn'
27
Example: Surface by Rotated Curve
Create an interpolated curve from a series of data points.
Rotate the curve to get the corresponding surface.
source code can be found in 'ch10_graphics_demo.mn'
38
Animated Camera
Camera trajectory
Lorenz attractor
source code can be found in 'ch10_graphics_demo.mn'
39
Key Takeaways
Now, you are able to plot 2-D and 3-D graphs using different objects
and attributes, generate 2-D and 3-D animations with different
objects and attributes, and to control colors and cameras for your
graphs.