In: Physics
Using Matlab code, solve the following:
(a) Consider first the undamped pendulum ? + sin ? = 0, ?(0) = 0, ? (0) = b. Let x = ? and y = ? ; then x and y satisfy the system x = y y = ? sin x, x(0) = 0 y(0) = b. Solve this system numerically and plot, on a single graph, the resulting trajectories for the initial velocities b = 0.5, 1, 1.5, 2, 2.5. Use a positive time range (e.g., 0 ? t ? 15), and use axis equal to improve your pictures.
(b) Based on your pictures in part (a), describe physically what the pendulum seems to be doing in the three cases ? (0) = 1.5, 2, and 2.5.
(c) The energy of the pendulum is defined as the sum of kinetic energy (? )2/2 and potential energy 1 ? cos ?, so E = 1 2 (? ) 2 + 1 ? cos ? = 1 2 y2 + 1 ? cos x. Show, by taking the derivative dE/dt, that E is constant when ?(t) is a solution to the equation. What basic physical principle does this represent?
(d) Use ezcontour to plot the level curves for the energy. Choose the x and y ranges according to where most of the solutions from part (a) lie. Explain how your picture is related to the trajectory plot from part (a).
(e) If the pendulum reaches the upright position (i.e., ? = ?), what must be true of the energy? Now explain why there is a critical value E0 of the energy, below which the pendulum swings back and forth without reaching the upright position, and above which it swings overhead and continues to revolve in the same direction. What is the critical value E0? What is the value of b corresponding to E0? What do you expect the pendulum to do when b has this critical value? What did the plot in part (a) show? Explain.
(f) Now consider the damped pendulum ? + 0.5? + sin ? = 0, ?(0) = 0, ? (0) = b. Numerically solve the corresponding first order system (which you must determine) and plot the resulting trajectories for the initial velocities b = 0.5, 1, 1.5, ..., 6. You will notice that each of the trajectories in your graph tends toward either the critical point (0, 0) or the critical point (2?, 0). Explain what this means physically. There is a value b0 for which the trajectory tends toward the critical point (?, 0). Estimate, up to two-decimal accuracy, the value of b0. What would this correspond to physically?
(g) Recall the energy defined in part (c). Compute E and determine which of the following are possible: (1) E is increasing, (2) E is decreasing, (3) E is constant. Explain how the possibilities are reflected in the solutions to part (f).
use following matlab cose for a,b,c,d . program is user friendly so you can change and see for different values given in the question:
%Program Body
clear
clc
t= linspace(0,70);
%Input
prompt= 'For damped oscillation consider the following forces
F1=-
b*v and F2=k*x. Insert the mass of the particle, damping constant
b
and the spring force constant k \n';
m= input(prompt);
b= input(prompt);
k= input(prompt);
prompt = 'Insert the initial position of particle \n';
a= input(prompt);
%Defining functions
T= 2*m/b;
w= sqrt((k/m)-(b.^2/(4*m.^2)));
f= a*cos(w*t).*exp(-t/T);
v= gradient(f);
A= gradient(gradient(f));
K=0.5.*m.*(v.^2);
p=(0.5).*k.*(f.^2);
E= K+p;
%Obtaing the required subplots
%Displacement
subplot(2,2,1);
t= linspace(0,70);
plot(t,f);
title('Subplot 1: Displacement');
ylabel('Displacement');
xlabel('Time');
grid on;
grid minor;
%Velocity
subplot(2,2,2);
t= linspace(0,70);
plot(t,v);
title('Subplot 2: Velocity');
ylabel('Velocity');
xlabel('Time');
grid on;
grid minor;
%Acceleration
subplot(2,2,3);
t= linspace(0,70);
plot(t,A);
title('Subplot 3: Acceleration');
ylabel('Acceleration');
xlabel('Time');
grid on;
grid minor;
%Energy
subplot(2,2,4);
t= linspace(0,70);
plot(t,E);
title('Subplot 4: Energy');
ylabel('Energy');
xlabel('Time');
grid on;
grid minor;
%Program-end