(*^
::[ Information =
"This is a Mathematica Notebook file. It contains ASCII text, and can be
transferred by email, ftp, or other text-file transfer utility. It should
be read or edited using a copy of Mathematica or MathReader. If you
received this as email, use your mail application or copy/paste to save
everything from the line containing (*^ down to the line containing ^*)
into a plain text file. On some systems you may have to give the file a
name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
The line below identifies what version of Mathematica created this file,
but it can be opened using any other version as well.";
FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2";
MacintoshStandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times";
fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times";
fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = input, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 12, "Courier";
fontset = output, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-4, 12, "Courier";
fontset = message, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "Courier";
fontset = print, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "Courier";
fontset = info, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "Courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier";
fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Times";
fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = leftheader, inactive, L2, 12, "Times";
fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, 12, "";
fontset = leftfooter, inactive, L2, 12, "Times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Courier";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 14, "Times";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "";
paletteColors = 128; automaticGrouping; currentKernel;
]
:[font = title; inactive; preserveAspect; startGroup]
Example 05
Two Dimensional Graphics
Using Plot[]
;[s]
2:0,0;43,1;50,-1;
2:1,25,18,Times,1,24,0,0,0;1,23,17,Courier,1,24,0,0,0;
:[font = subsubtitle; inactive; preserveAspect]
Copyright ã 1993 by Bill Titus, Carleton College,
Department of Physics and Astronomy, Northfield, MN 55057-4025
September 6, 1993
;[s]
3:0,0;10,1;11,0;133,-1;
2:2,16,12,Times,2,14,0,0,0;1,16,12,Symbol,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Topics and Skills
:[font = special1; inactive; preserveAspect; endGroup]
1. The bare Plot[] command.
2. The general function Options[].
3. Eliminating -Graphics- .
4. Resizing a plot area.
5. Reading out graph coordinates.
6. Displaying multiple graphs on a single plot using one Plot[] command.
7. The general structure of Plot[] options.
8. Curve options: Compiled, PlotPoints, PlotDivision,
MaxBend.
9. "Appearance" Options
a. Axes: Axes, AxesLabel, AxesOrigin, AxesStyle.
b. Frame: Frame, FrameStyle, FrameLabel, Ticks,
FrameTicks.
c. General: AspectRatio, PlotLabel, DefaultFont,
Background, DefaultColor, GridLines, PlotRange,
PlotStyle.
d. Graphics Directives: RGBColor[], Thickness[], GrayLevel[].
10. Assigning names to plots.
11. Plotting multiple graphs on a single plot using Show[].
12. Miscellaneous option: DisplayFunction.
13. GraphicsArray[].
14. Animation.
;[s]
65:0,0;15,1;21,0;59,1;68,0;88,1;98,0;224,1;230,0;272,1;278,0;310,1;318,0;321,1;331,0;334,1;346,0;354,1;361,0;406,1;410,0;413,1;422,0;425,1;435,0;438,1;447,0;468,1;473,0;476,1;486,0;489,1;499,0;501,1;506,0;520,1;530,0;553,1;564,0;567,1;576,0;579,1;590,0;605,1;615,0;619,1;631,0;634,1;643,0;646,1;655,0;669,1;678,0;713,1;723,0;726,1;737,0;740,1;751,0;838,1;844,0;874,1;889,0;896,1;911,0;929,-1;
2:33,16,12,Times,0,14,0,0,0;32,15,11,Courier,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Problem
:[font = special1; inactive; preserveAspect]
An object moves vertically in one dimension near the surface of the earth under the force due to gravity. Assuming that the object is launched from the origin and that the x-axis points vertically upward, the relevant equations are
:[font = special1; inactive; preserveAspect]
v[t] = v[0] - gt
x[t] = v[0]t - (1/2)gt2,
;[s]
4:0,0;2,1;42,2;43,1;45,-1;
3:1,16,12,Times,0,14,0,0,0;2,15,11,Courier,0,14,0,0,0;1,23,15,Courier,32,14,0,0,0;
:[font = special1; inactive; preserveAspect; endGroup]
where g = 9.8 m/s2. Plot v[t] and x[t] as a function of t when the initial velocity v[0] equals 20 m/s and 40 m/s.
;[s]
3:0,0;18,1;19,0;128,-1;
2:2,16,12,Times,0,14,0,0,0;1,24,16,Times,32,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Solution: Creating the Appropriate Functions
:[font = subsection; inactive; preserveAspect; startGroup]
Step 1 - Complete the code below which creates the functions x[vo,t] and v[vo,t] that allows you to calculate the position and velocity of the object as a function of the initial velocity vo and the time t. When you're done, activate the cell.
;[s]
5:0,0;62,1;69,0;76,1;83,0;252,-1;
2:3,16,12,Times,1,14,0,0,0;2,15,11,Courier,1,14,0,0,0;
:[font = input; preserveAspect; endGroup]
Clear[g, vo, t, v, x]
g = 9.8;
v[vo_, t_] =
x[vo_, t_] =
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
1. You could have included g as an argument in the functions. What would be the advantages and disadvantages of doing so?
2. Did you use semicolons to suppress any output? If so, why? If not, why not?
:[font = section; inactive; preserveAspect; startGroup]
Solution: The Bare Plot
:[font = subsection; inactive; preserveAspect]
Step 1 - Use help and extended help to find and describe the MMA command for plotting curves in two dimension.
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup]
1. How do the results for the commands ? and ?? applied to Plot[] differ?
2. Options[] looks like a function. It is. When applied to the head of a function, it gives the options of a function, but not the function's usage statement. You'll use this command later on.
3. For now, don't worry about the options to Plot[]. To start with, just concentrate on the bare Plot[] command. What do you know about this command so far?
;[s]
13:0,0;41,1;42,0;49,1;51,0;65,1;71,0;85,1;94,0;326,1;332,0;380,1;386,0;442,-1;
2:7,16,12,Times,0,14,0,0,0;6,15,11,Courier,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect]
Step 2 - For vo = 20, plot x[vo, t] from t = 0.0 to 5.0. Describe what you see displayed.
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 2
:[font = special1; inactive; preserveAspect; endGroup]
1. Select the cell containing the plot by clicking on its cell boundary. Then use the Format \ Style Inspector on the NeXT or Style \ Cell Style on the Mac to find out the cell style for the cell containing the plot.
2. What's the cell style of the cell containing the word -Graphics- ?
3. The cell with -Graphics- doesn't seem to serve a purpose other than bookkeeping. You can prevent this cell from appearing on the screen by putting a semicolon after Plot[]. Try it.
4. In your function x[vo,t], should you replace vo by 20 or 20.0?
;[s]
13:0,0;89,1;113,0;131,1;149,0;284,2;294,0;318,2;328,0;472,2;478,0;511,2;518,0;562,-1;
3:7,16,12,Times,0,14,0,0,0;2,15,11,Helvetica,0,14,0,0,0;4,15,11,Courier,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect]
Step 3 - Click inside the graph. You should see an outline of a box appear around the plot that has eight handles. Click and drag one of the handles. Describe what happens. Note that you can't move the sides of the outlined box independently. Why not?
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 3
:[font = special1; inactive; preserveAspect; endGroup]
1. The aspect ratio is preserved unless you uncheck "Preserve aspect ratio" in NeXT's Style Inspector's Graphics Attributes menu or in the menu item Graph on the Mac.
;[s]
5:0,0;107,1;127,0;153,1;158,0;172,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Helvetica,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect]
Step 4 - Disable the Preserve aspect ratio, and then click and drag on one of the handles in the plot area. What happens now?
;[s]
3:0,0;21,1;42,0;127,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Helvetica,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect]
Step 5 - Read out coordinates in the graph region by clicking on the graph to highlight it, holding down the key, and moving the mouse without clicking. Coordinates are displayed in the bottom right corner of the MMA window on the NeXT and in the bottom left corner on the Mac.
;[s]
3:0,0;108,1;118,0;290,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Helvetica,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; endGroup]
Step 6 - Plot graphs of x[t] versus t for vo equal to 20.0 and 40.0 on the same plot. To do so, just include the functions to be plotted in a list as the first argument of Plot[].
;[s]
3:0,0;185,1;191,0;193,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Courier,1,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Solution - Comments on Plot[]'s Options
;[s]
3:0,0;25,1;31,0;42,-1;
2:2,19,14,Times,1,18,0,0,0;1,18,13,Courier,1,18,0,0,0;
:[font = subsection; inactive; preserveAspect]
Step 1 - Find out the possible options for Plot[] by using the MMA function Options[].
;[s]
5:0,0;44,1;50,0;79,1;88,0;90,-1;
2:3,16,12,Times,1,14,0,0,0;2,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
1. The options are all in the form of rules with the right hand side of the rules set to various values or expressions. Where else have you seen rules used?
2. The options listed above have the default settings; other possible setting are discussed in Wolfram, A.8, "Listing of Built-in Mathematica Objects".
3. Automatic setting use various internal algorithms to choose appropriate values for parameters.
4. Options are added to the Plot[] command after the range specification in Plot[]'s argument. Each option is separated from one another by commas.
5. There are two classes of options for Plot[]: (1) those that effect the calculation of the curve, and (2) those that enhance the overall appearance of the graph.
;[s]
9:0,0;291,1;302,0;443,2;449,0;493,2;499,0;609,2;615,0;737,-1;
3:5,16,12,Times,0,14,0,0,0;1,16,12,Times,2,14,0,0,0;3,15,11,Courier,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Solution - "Curve" Options
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
1. There are four "curve" options specific to Plot[].
2. Compiled -> True causes expressions to be automatically compiled. Why might you want to do this? If you need high precision, you should set this option to False.
3. PlotPoints gives the minimum number of points sampled. This is usually the option you should try if you want to increase resolution.
4. PlotDivision gives the maximum number of times an interval is subdivided.
5. MaxBend is the maximum angle (in degrees) between sampled points, consistent with the value of PlotDivision.
6. See Blachman, Sec. 4.2.2, for a nice example of plotting problems that can occur because of MMA's adaptive sampling procedure.
;[s]
15:0,0;48,1;54,0;60,1;76,0;219,1;224,0;230,1;240,0;369,1;381,0;448,1;455,0;545,1;557,0;691,-1;
2:8,16,12,Times,0,14,0,0,0;7,15,11,Courier,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Solution - "Appearance" Options
:[font = subsection; inactive; preserveAspect; startGroup]
Step 1 - You're going to look at a small, but useful set of plot options in some detail and the remaining options more superficially. Activate the cell below and ascertain what the various options are doing.
:[font = input; preserveAspect; endGroup]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
PlotRange -> {{0, 4.5}, {0, 25}}
];
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup]
1. Get help on each of the four options used in the plot above.
2. Get help on the graphics directives RGBColor[] and FontForm[].
3. Note how strings, the stuff between double quotes, are used for plotting purposes.
;[s]
5:0,0;106,1;116,0;124,1;134,0;223,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Courier,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Step 2 - Activate the following cells to get a feeling for some of the other options that are available for Plot[].
;[s]
3:0,0;110,1;116,0;118,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Courier,1,14,0,0,0;
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
AspectRatio -> 0.25
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
AxesOrigin -> {2.1, 0.0}
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
Axes -> {True, False}
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> "Position versus Time",
DefaultFont -> {"Helvetic-Bold", 16}
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
AxesStyle -> {RGBColor[0, 0, 1], Thickness[0.02]}
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
Background -> GrayLevel[0.5]
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
DefaultColor -> RGBColor[0.2, 0, 1]
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
AxesLabel -> {"t", "x"},
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
Ticks -> {{2, 4}, Automatic}
];
:[font = input; preserveAspect]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
Frame -> True,
FrameLabel -> {"t", "x"},
FrameStyle -> RGBColor[0, 0, 1]
];
:[font = input; preserveAspect; endGroup]
Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
PlotLabel -> FontForm["Position versus Time",
{"Helvetica-Bold", 12}],
Frame -> True,
FrameLabel -> {"t", "x", "x vs t", ""},
FrameTicks -> {{0, 2, 4},
{-15, 0, 15}},
GridLines -> { {0, 2, 4}, {-15, 0, 15}},
PlotRange -> {-30, 30}
];
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 2
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
1. Frame diagrams are quite useful. One can get a lot of milage out of the options Frame and FrameLabel. The latter option is a cheap way to title your plot as well as label the axes.
;[s]
5:0,0;86,1;91,0;98,1;108,0;190,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Courier,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Multiple Plots
:[font = subsection; inactive; preserveAspect]
Step 1 - Produce four separate framed plots: x[20,t], v[20,t], x[40,t], and v[40,t]. Each plot should have its axes appropriately labeled. Draw the curves in a different color for each value of v[0]. Assign the plots the names plotx1, plotv1, plotx2, and plotv2, respectively. In writing your code, make liberal use of copy and paste.
;[s]
17:0,0;46,1;53,0;56,1;63,0;66,1;73,0;81,1;88,0;237,1;243,0;246,1;252,0;255,1;261,0;269,1;275,0;352,-1;
2:9,16,12,Times,1,14,0,0,0;8,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 1
:[font = special1; inactive; preserveAspect; endGroup]
1. Why might it be useful to assign names to plots?
2. An error message appears. What's it about?
:[font = subsection; inactive; preserveAspect]
Step 2 - Display plotx1 and plotx2 together, and plotv1 and plotv2 together by using the MMA command Show[].
;[s]
11:0,0;18,1;24,0;31,1;37,0;54,1;60,0;67,1;73,0;110,1;116,0;119,-1;
2:6,16,12,Times,1,14,0,0,0;5,15,11,Courier,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 2
:[font = special1; inactive; preserveAspect; endGroup]
1. Did you get help on Show[]? If not, do so.
2. How else have you displayed multiple graphs on the same plot? How does that technique compare to the technique using Show[]?
;[s]
5:0,0;25,1;31,0;172,1;178,0;180,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Courier,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Step 3 - Suppose you didn't want the individual plots to be shown, but just the composite ones. To do so, you can insert the option
:[font = text; inactive; preserveAspect]
DisplayFunction -> Identity
;[s]
3:0,0;5,1;32,2;35,-1;
3:1,13,10,Courier,1,12,0,0,0;1,15,11,Courier,1,14,0,0,0;1,13,9,Times,0,12,0,0,0;
:[font = text; inactive; preserveAspect]
in each individual plots and then the option
;[s]
2:0,0;45,1;55,-1;
2:1,16,12,Times,1,14,0,0,0;1,13,9,Times,0,12,0,0,0;
:[font = text; inactive; preserveAspect]
DisplayFunction -> $DisplayFunction
;[s]
2:0,0;5,1;41,-1;
2:1,13,10,Courier,1,12,0,0,0;1,15,11,Courier,1,14,0,0,0;
:[font = text; inactive; preserveAspect]
in Show[]. Try this out by activating the two cells below.
;[s]
3:0,0;4,1;10,0;61,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Courier,1,14,0,0,0;
:[font = input; preserveAspect]
Clear[plotx1, plotv1, plotx2, plotv2]
plotx1 = Plot[x[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
Frame -> True,
FrameLabel -> {"t", "x"},
DisplayFunction -> Identity];
plotv1 = Plot[v[20, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
Frame -> True,
FrameLabel -> {"t", "v"},
DisplayFunction -> Identity];
plotx2 = Plot[x[40, t], {t, 0, 5.0},
PlotStyle -> RGBColor[0, 0, 1],
Frame -> True,
FrameLabel -> {"t", "x"},
DisplayFunction -> Identity];
plotv2 = Plot[v[40, t], {t, 0, 5.0},
PlotStyle -> RGBColor[0, 0, 1],
Frame -> True,
FrameLabel -> {"t", "v"},
DisplayFunction -> Identity];
:[font = input; preserveAspect; endGroup]
Show[plotx1, plotx2,
DisplayFunction -> $DisplayFunction];
Show[plotv1, plotv2,
DisplayFunction -> $DisplayFunction];
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 3
:[font = special1; inactive; preserveAspect; endGroup]
1. Options placed in Show[] override those in the individual graphics.
2. The symbol $ signifies pre-defined global variables. Get help on $DisplayFunction and then locate all the symbol that have a $ in front.
;[s]
9:0,0;23,1;30,0;89,1;90,0;146,1;162,0;208,1;209,0;221,-1;
2:5,16,12,Times,0,14,0,0,0;4,15,11,Courier,0,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Step 4 - You can produce a two dimension graphics array of plots using a combination of the MMA functions GraphicArray[] and Show[]. Get help on GraphicsArray[] and then activate the cell below. You should find that the first row has plotx1 and plotv1, while the second row has plotx2 and plotv2.
;[s]
15:0,0;107,1;121,0;128,1;134,0;151,1;166,0;243,1;249,0;256,1;262,0;290,1;296,0;303,1;309,0;311,-1;
2:8,16,12,Times,1,14,0,0,0;7,15,11,Courier,1,14,0,0,0;
:[font = input; preserveAspect; endGroup]
Show[
GraphicsArray[{{plotx1, plotv1}, {plotx2, plotv2}}]];
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 4
:[font = special1; inactive; preserveAspect; endGroup]
1. You may need to enlarge the graphics to see the individual plots better. How do you do this?
:[font = subsection; inactive; preserveAspect; startGroup]
Step 5 - Active the following cell which produces a table of plots of x[t] for vo going from 0 to 40 in steps of 5. The option
PlotRange -> {-100, 100}
is included so that all the plots have the same range.
;[s]
3:0,0;142,1;167,0;223,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Courier,1,14,0,0,0;
:[font = input; preserveAspect; endGroup]
Table[Plot[x[vo, t], {t, 0, 5.0},
PlotStyle -> RGBColor[1, 0, 0],
Frame -> True,
FrameLabel -> {"t", "x"},
PlotRange -> {-100, 100}],
{vo, 0, 40, 5}];
:[font = subsection; inactive; preserveAspect]
Step 6 - Double-click on the cell grouping for the plots and collapse the cells to a single cell. Then press -y. What happens?
;[s]
3:0,0;111,1;122,0;139,-1;
2:2,16,12,Times,1,14,0,0,0;1,15,11,Helvetica,1,14,0,0,0;
:[font = subsection; inactive; preserveAspect; startGroup]
Comment 6
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
1. Play with the animation controls.
2. You could also activate animation with Graph \ Animate Selected Graphics.
3. Do you see why it was nice to have the same range on all the plots?
4. Never save a file containing lots of graphics. Why?
5. Where else might grouping cells be useful?
;[s]
3:0,0;82,1;115,0;293,-1;
2:2,16,12,Times,0,14,0,0,0;1,15,11,Helvetica,0,14,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Save Your Notebook
:[font = special1; inactive; preserveAspect; endGroup; endGroup]
Remove any output cells from this notebook and then use Save As to store your notebook under the name myEx05.
;[s]
5:0,0;57,1;64,0;104,1;111,0;113,-1;
2:3,16,12,Times,0,14,0,0,0;2,15,11,Helvetica,0,14,0,0,0;
^*)