function [t,theta,theta_dot] = pendulum(theta_0,theta_dot_0,L,m,g,...
    del_t,max_t)
%

t = [0];
theta = [theta_0];
theta_dot = [theta_dot_0];

while t(end)<max_t
    theta_dot_next = theta_dot(end) + L*m*g*sin(theta(end))*del_t;
    theta_next = theta(end) + theta_dot(end)*del_t ...
        + L*m*g*sin(theta(end))*del_t^2;
    theta = [theta; theta_next];
    theta_dot = [theta_dot; theta_dot_next];
    t = [t; t(end)+del_t];
end
