% Integrate a spring-mass system

k=1; beta=.1;

X0 = [1;3;k;beta];
T = linspace(0,100,10000);
sol = lsode("pendulum", X0, T);

% Time series plot
%plot(sol(:,1:2));

% Phase diagram - velocity as function of position
title "The phase space diagram of a damped pendulum"
xlabel "Position"
ylabel "Velocity"
plot(sol(:,1),sol(:,2));
