Download<< Back
function y = pendulum(t, x) % OSCILLATOR Right hand side for harmonic oscillator equation: % % x_1' = x_2 % x_2' = -k sin(x_1) k=1; y = [x(2); -k*sin(x(1))]; end