Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

We considered The Pendulum Equation in lectures: theta\" + k theta + k/L sin(the

ID: 3160754 • Letter: W

Question

We considered The Pendulum Equation in lectures: theta" + k theta + k/L sin(theta) = 0 Previously, we linearised the sin term to allow us to solve the ODE analytically. Now we can use MATLAB to solve this non linear ODE. Let k = 2, L = 1 and g = 9.81. The initial conditions are theta(0) = 0.1 and theta'(0) = 0. Use MATLAB s ode45 command to solve this nonlinear ODE. Plot your numerical solution and the analytic solution we obtained in the lecture (include your MATLAB code). Comment on the similarities and/or differences between the numerical and analytic solutions.

Explanation / Answer

a)

clc; clear all;
L = 1 ; g =9.8; k =2;
r = g/L;
f = (t,x) [x(2);-k*x(2) -r*sin(x(1))];
init = [pi/2; 0];
[t,x] = ode45 (f,[0 10],init);
plot(t,x(:,1));
grid on; hold on;
plot(t,x(:,2),'k');
xlabel('Time (s)');
ylabel('Amplitude');
legend({'Angle (rad)','Angular speed (rad/s)'});

b)

An analytical solution to a problem is one that has a "proof": a series of logical steps that can be followed and verified as correct. If you use the quadratic formula to solve for x in a quadratic equation, this is an analytical solution to the problem.

In contrast to this, some problems are solved via other means. If, instead of using the quadratic formula, you try a lot of values for x and y, this is a numerical solution. Some problems simply do not have analytical solutions and must be approximated using numerical methods -- for example, many complicated integrals.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote