INTRODUCTORY RECIPES 9
Maple is unable to find an analytic solution, returning the integral without
evaluating it. So, let’s enter the given parameter values, a =3, b = π/8, and
c = 10. Note that the command Pi for entering π is capitalized. Maple is case
sensitive here.
>
a:=3: b:=Pi/8: c:=10:
The time T =12.99 minutes, which is now entered, is the approximate time for
Bertie to complete one circuit. It is determined by trial and error by numerically
calculating the total distance to 4 digits, using the floating point evaluation
(evalf) command. Increasing T will not change the answer to this accuracy.
>
T:=12.99; distance:=evalf(d,4);
T := 12.99 distance := 23.98
Bertie travels a total distance of about 24 sretem in one complete circuit.
To animate Bertie’s flight and superimpose the motion on a plot of the entire
route, special plots commands are required. These are contained in the plots
library package, which is now “loaded”.
>
with(plots);
Warning, the name changecoords has been redefined
[animate, animate3d, ... display, ... polarplot, ... textplot3d, tubeplot]
The with( ) command is used to load Maple library packages. Normally, I
would place a colon on the above command line to suppress the output, but
here a partial list of the large number of specialized plot commands that are
available in the plots package is shown. The commands animate, polarplot (to
plot the trajectory in polar coordinates), and display (to superimpose graphs)
in the output list will be used here. There is also a warning message that the
name changecoords has been redefined. This warning appears even if a colon
is used. If desired, warnings can be removed by using a colon and inserting
the command interface(warnlevel=0) prior to loading the library package.
From now one, I will generally artificially remove all such warnings in the text.
In the first graph, gr1, an animation of Bertie’s motion is created with
the animate command. To fit into the width of the page, the lengthy Maple
command line is broken over two text lines. Bertie’s X and Y coordinates are
entered as a Maple list. The time range is taken from t =0toT . I have chosen
to use 500 frames (the default is 25) to make a reasonably smooth animation.
A point style is chosen, Bertie being represented by a size 16 blue circle. A
line-ending colon is used to prevent the plotting numbers from being displayed.
>
gr1:=animate([X,Y],t=0..T,frames=500,style=point,
symbol=circle,color=blue,symbolsize=16):
The polarplot command is used in gr2 to graph the entire route as a thick
(the default thickness is 0) orange line. To obtain a smooth curve, a minimum
of 500 (the default is 50) plotting points is requested.
>
gr2:=polarplot([r,theta,t=0..T],numpoints=500,style=line,
color=orange,thickness=2):
The graphs are now superimposed with the display command, the axis labels