Preface


This is a tutorial made solely for the purpose of education and it was designed for students taking Applied Math 0330. It is primarily for students who have very little experience or have never used Mathematica before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.

Finally, the commands in this tutorial are all written in bold black font, while Mathematica output is in regular fonts. This means that you can copy and paste all commands into Mathematica, change the parameters and run them. You, as the user, are free to use the scripts to your needs for learning how to use the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the second course APMA0330
Return to Mathematica tutorial for the first course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part I of the course APMA0330

Cycloids


A cycloid is the curve traced by a point on the rim of a circular wheel e of radius a rolling along a straight line. It was studied and named by Galileo in 1599. Its curve can be generalized by choosing a point not on the rim, but at any distance b from the center on a fixed radius. If b=a, we get a usual cycloid.

The Parametrization of the cycloid can be made through the following equations:

cycloid[a_, b_][t_] := {a*t - b*Sin[t], a - b*Cos[t]}
Manipulate[
ParametricPlot[
cycloid[a, b][t] // Evaluate, {t, -\[Pi]/2, 5*\[Pi]/2}], {a, 1, 5}, {b, 1, 5}]
cycloid[a_, b_][t_] := {a*t - b*Sin[t], a - b*Cos[t]}

axes[x_, y_, f_, a_] :=
Graphics[Join[{Arrowheads[a]},
Arrow[{{0, 0}, #}] & /@ {{x, 0}, {0, y}}, {Text[
Style["x", FontSize -> Scaled[f]], {0.9*x, .15*y}],
Text[Style["y", FontSize -> Scaled[f]], {0.07 x, 1*y}]}]]
data1 = Table[{t, cycloid[1, 1][t][[1]], cycloid[1, 1][t][[2]]}, {t,
0, 2 \[Pi], 0.01}];
Show[ListLinePlot[{#2, #3} & @@@ data1,
PlotRange -> {{-\[Pi]/4, 3 \[Pi]}, {0, 3}},
AspectRatio -> Automatic, Ticks -> {None, None}, Frame -> False,
PlotRange -> All, PlotRangeClipping -> False,
ImagePadding -> {{20, 20}, {20, 20}}], axes[9.7, 3.2, .07, .07],
Graphics[{{Dashed, Circle[{0, 1}, 1]}, Point[{\[Pi] + .5, 1}],
Point[{4.123, 1.9}], Circle[{\[Pi] + .5, 1}, 1],
Line[{{0, 0}, {0, 1}}], Point[{0, 0}], Point[{\[Pi]*2, 1}],
Point[{\[Pi]*2, 0}],
Point[{0, 1}], {Dashed, Circle[{\[Pi]*2, 1}, 1]},
Line[{{\[Pi]*2, 0}, {\[Pi]*2, 1}}],
Line[{{\[Pi] + .5, 1}, {4.123, 1.9}}]}]]
Another simple plot:
arametricPlot[{t - 2*Sin[t], 1 - 2*Cos[t]}, {t, 0, 3 Pi}, AxesLabel -> {"x", "y"}, PlotLabel -> "Cycloid", AspectRatio -> Automatic]

Now we plot cycloid downward:

axes[x_, y_, f_, a_] :=
Graphics[Join[{Arrowheads[a]},
Arrow[{{0, 0}, #}] & /@ {{x, 0}, {0, y}}, {Text[
Style["x", FontSize -> Scaled[f]], {0.9*x, .08*y}],
Text[Style["y", FontSize -> Scaled[f]], {0.1 x, 1*y}]}]]
data1 = Table[{t, cycloid[1, 1][t][[1]], cycloid[1, 1][t][[2]]}, {t,
0, 2 \[Pi], 0.01}];
Show[ListLinePlot[{#2, -#3} & @@@ data1,
PlotRange -> {{-\[Pi]/4, 3 \[Pi]}, {-3, 0}},
AspectRatio -> Automatic, Ticks -> {None, None}, Frame -> False,
PlotRange -> All, PlotRangeClipping -> False,
ImagePadding -> {{20, 20}, {20, 20}}], axes[9.7, -3.2, .07, .07],
Graphics[{{Dashed, Circle[{0, -1}, 1]}, Point[{\[Pi] + .5, -1}],
Point[{4.123, -1.9}], Circle[{\[Pi] + .5, -1}, 1],
Line[{{0, 0}, {0, -1}}], Point[{0, 0}], Point[{\[Pi]*2, -1}],
Point[{\[Pi]*2, 0}],
Point[{0, -1}], {Dashed, Circle[{\[Pi]*2, -1}, 1]},
Line[{{\[Pi]*2, 0}, {\[Pi]*2, -1}}],
Line[{{\[Pi] + .5, -1}, {4.123, -1.9}}]}]]
Now we plot orthogonal curves to cycloid:
axes[x_, y_, f_, a_] :=
Graphics[Join[{Arrowheads[a]},
Arrow[{{0, 0}, #}] & /@ {{x, 0}, {0, y}}, {Text[
Style["x", FontSize -> Scaled[f]], {0.9*x, .08*y}],
Text[Style["y", FontSize -> Scaled[f]], {0.1 x, 1*y}]}]]
data1 = Table[{\[Tau], Cycloid[1, \[Tau]][[1]],
Cycloid[1, \[Tau]][[2]]}, {\[Tau], 0, 2 \[Pi], 0.01}];
data2 = Table[{\[Tau], Cycloid[1.5, \[Tau]][[1]],
Cycloid[1.5, \[Tau]][[2]]}, {\[Tau], 0, 3.14^2 - 0.6, 0.01}];
data1a = Table[{\[Rho], Cycloid[\[Rho], 2][[1]],
Cycloid[\[Rho], 2][[2]]}, {\[Rho], .3, 10, .01}];
data2a = Table[{\[Rho], Cycloid[\[Rho], 3][[1]],
Cycloid[\[Rho], 3][[2]]}, {\[Rho], .5, 10, .01}];
data3a = Table[{\[Rho], Cycloid[\[Rho], 4][[1]],
Cycloid[\[Rho], 4][[2]]}, {\[Rho], .65, 10, .01}];
Show[ListLinePlot[{#2, -#3} & @@@ data1, AspectRatio -> Automatic,
PlotRange -> {{-\[Pi]/4, 5*\[Pi]}, {-5, 0}},
PlotStyle -> {Black, Thick}, Ticks -> {None, None}, Frame -> False,
PlotRange -> All, PlotRangeClipping -> False,
ImagePadding -> {{20, 20}, {20, 20}}],
ListLinePlot[{#2, -#3} & @@@ data2, PlotStyle -> {Black, Thick},
PlotRange -> {{-\[Pi]/4, 2*\[Pi] + \[Pi]/4}, {-5, 0}},
Ticks -> {None, None}, Frame -> False, PlotRange -> All,
PlotRangeClipping -> False, ImagePadding -> {{20, 20}, {20, 20}}],
ListLinePlot[{#2, -#3} & @@@ data1a,
PlotRange -> {{-\[Pi]/4, 2*\[Pi] + \[Pi]/4}, {-5, 0}},
Ticks -> {None, None}, Frame -> False, PlotRange -> All,
PlotStyle -> {Blue}, PlotRangeClipping -> False,
ImagePadding -> {{20, 20}, {20, 20}}],
ListLinePlot[{#2, -#3} & @@@ data2a,
PlotRange -> {{-\[Pi]/4, 2*\[Pi] + \[Pi]/4}, {-5, 0}},
Ticks -> {None, None}, Frame -> False, PlotRange -> All,
PlotStyle -> {Blue}, PlotRangeClipping -> False,
ImagePadding -> {{20, 20}, {20, 20}}],
ListLinePlot[{#2, -#3} & @@@ data3a,
PlotRange -> {{-\[Pi]/4, 2*\[Pi] + \[Pi]/4}, {-5, 0}},
Ticks -> {None, None}, Frame -> False, PlotStyle -> {Blue},
PlotRange -> All, PlotRangeClipping -> False,
ImagePadding -> {{20, 20}, {20, 20}}], axes[16.5, -5.2, .07, .07]]

 

 

 

Return to Mathematica page

Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)
Return to the Part 7 (Boundary Value Problems)