Question 4
Contents
Initial condition
[t,x] = ode23(@pendulum, [0,6*pi], [-1.5, 0]);
figure;
plot(t,x(:,1),'DisplayName','x');
hold on;
plot(t,x(:,2),'DisplayName','x''');
xlabel('t');
legend('Location','SouthEast');
Initial condition
[t,x] = ode23(@pendulum, [0,6*pi], [-3, 0]);
figure;
plot(t,x(:,1),'DisplayName','x');
hold on;
plot(t,x(:,2),'DisplayName','x''');
xlabel('t');
legend('Location','SouthEast');
Initial condition
[t,x] = ode23(@pendulum, [0,6*pi], [-pi, 0]);
figure;
plot(t,x(:,1),'DisplayName','x');
hold on;
plot(t,x(:,2),'DisplayName','x''');
xlabel('t');
legend('Location','SouthEast');