(* Student Name *)
(* Date *)
(* MITES Physics III: Intro to Oscillations and Waves *)
(* Numerical Solution to Differential Equations *)


(* Annotate the following code explaining the utility of each line *)

x0 = 5.0;

xdot0 = 0.0;

e = 0.01;

xvalues= ConstantArray[0,500];

xdotvalues= ConstantArray[0,500];

xvalues[[1]] = x0;

xdotvalues[[1]] = xdot0;

For[i=2,
i<501,
i++,
xvalues[[i]] = xvalues[[i-1]]+e*xdotvalues[[i-1]];
xdotvalues[[i]] = xdotvalues[[i-1]]+e*7.0*xvalues[[i-1]]]

ListPlot[xvalues]

(* Rewrite the code above so that it solves the differential equation for simple harmonic motion with initial conditions given in the prompts *)

(* Rewrite the code above so that it solves the differential equation for Pendulum Motion with initial conditions given in prompt *)