v. 2: updated Jan 22, 11:20 am.
This is a modification of a Mathematica notebook written by my son, Michael Swift, for a junior level mechanics course in the physics department at Rice University.  They use a slightly different parameters to define the system than our book.   If ω0=1, then the three remaining parameters, c, ρ, and ω, are the same.  

Use the Insert menu with Instert File Path... to set the place where animations are saved.

SetDirectory["/Users/jimswift/Dropbox/classes/MAT 667 2017.1/DrivenPendulumAnimations/"] (* for Jim's home *)
SetDirectory["C:\\Users\\jws8\\Dropbox\\classes\\MAT 667 2017.1\\DrivenPendulumAnimations\\"]  (* for Jim's office *)

Now define the parameters, and run the program.

An animated gif is produced if makeMovie is True.  The pendulum will be animated next to the graph of its behavior, and a red dot follows the pendulum’s current position on the graph.  The notebook will also show you how long it took to create the movie, which allows you to predict how long you’ll need to wait for a movie that has a lot of frames.

This setup is fairly flexible; you can change almost anything about the system and get an animation.  Simply run one of the cells below then change makeMove to True, and  the animation will appear in the directory specified in the SetDirectory command at the top.

ρ = 1.4917;
ω = 2*Pi;
ω0 = 1.5*ω;
c = 0.5;
tfin = 20;
ϕ0 = 0;
v0 = 0;
step = 1/30;
filename = "Jeffrey.gif"; 
makeMovie = False;
runPendulum

ρ = 5;
ω = 2*Pi;
ω0 = 1.5*ω;
c = 50;
nTransient = 0;
tfin = 10;
ϕ0 = -0.24791728896761778`;
v0 = 18.53003227588474`;
step = 1/30;
filename = "Shehara.gif";
makeMovie = False;
runPendulum

ρ = 2;
ω = 2*Pi;
ω0 = 1.5*ω;
c = 1/3;
tfin = 20;
ϕ0 = 4 Pi;
v0 = 0;
step = 1/30;
filename = "Jimie.gif";
makeMovie = False;
runPendulum

ρ = 1.69;  (* amplitde of external force *)
ω = 2*Pi;  (* The external force has period 1 *)
ω0 = 
 1.5*ω;  (* The natural frequency is 3/2 times the driving \
frequency *)
c = 0.5;  (* Damping constant *)
tfin = 10; (* final time *)
ϕ0 = - 2 Pi;  (* initial angle *)
v0 = 0;  (* inital velocity *)
filename = "Scott.gif";
makeMovie = False;
runPendulum

ρ = .9;  (* amplitde of external force *)
ω = 2*Pi;  (* The external force has period 1 *)
ω0 = 
 1.5*ω;  (* The natural frequency is 3/2 times the driving \
frequency *)
c = 1/2;  (* Damping constant *)
tfin = 10; (* final time *)
ϕ0 = - 2 Pi;  (* initial angle *)
v0 = 0;  (* inital velocity *)
makeMovie = False;
step = 1/30;  (* time step in frames of the movie, if made *)
filename = "Philip.gif";  (* Can also use .mov or .avi or \
other video format *)
runPendulum

ρ = 10;  (* amplitde of external force *)
ω = 2*Pi;  (* The external force has period 1 *)
ω0 = 
 1.5*ω;  (* The natural frequency is 3/2 times the driving \
frequency *)
c = 1/2;  (* Damping constant *)
tfin = 10; (* final time *)
ϕ0 = - 2 Pi;  (* initial angle *)
v0 = 0;  (* inital velocity *)
makeMovie = False;
step = 1/30;  (* time step in frames of the movie, if made *)
filename = "AllisonL.gif";  (* Can also use .mov or .avi or \
other video format *)
runPendulum

ρ=2.04;
ω=2*Pi;
ω0=1.5*ω;  (* That is ω/ω0 = 2/3 *)
c = 1;
nTransient = 0;
tfin=8;  
ϕ0 = 0;  (* initial angle *)
v0 = 0;  (* inital velocity *)
makeMovie = False;
step = 1/30;  (* time step in frames of the movie, if made *)
filename = "Jim.gif";  (* Can also use .mov or .avi or \
other video format *)
runPendulum