ODE I
Exercise 2

The resulting energy plots are labeled:
Energy_tau0.1.pdf
Energy_tau0.01.pdf
Energy_tau0.001.pdf

The results improve significantly for smaller time steps. A Python session showing the results of pen_energy.py is shown below.

In [80]: run pend_energy.py
Starting position for pendulum in degrees: 10
Estimated period is 6.34482 s 
Approximate number of periods to plot: 5
Size of the time step (s): 0.1
The fractional change in energy is 19.2737 or 1927.37 percent.

In [81]: run pend_energy.py
Starting position for pendulum in degrees: 10
Estimated period is 6.34482 s 
Approximate number of periods to plot: 5
Size of the time step (s): 0.01
The fractional change in energy is 0.362634 or 36.2634 percent.

In [82]: run pend_energy.py
Starting position for pendulum in degrees: 10
Estimated period is 6.34482 s 
Approximate number of periods to plot: 5
Size of the time step (s): 0.001
The fractional change in energy is 0.0314459 or 3.14459 percent.

The percent error for a 0.1 sec time step is a staggering 1927 % and drops to about 3 % for a time step of 0.001 sec. This is a substantial improvement, but the price is run time. The program was essentially instantaneous on my computer of 0.1 sec, but took about 6 seconds for 0.001 sec.