For a damped driven pendulum, the motion of the pendulum is decsribed by (theta)
ID: 2963061 • Letter: F
Question
For a damped driven pendulum, the motion of the pendulum is decsribed by (theta)''(t) + (g/L)sin((theta)(t)) = 0, knowing g=32.2 ft.sec^2 and assuimng that L=32.2 ft we can simply the equation to (theta)'' + sin(theta) = 0. And when theta is small and motion displacement is small then sin(theta) = (theta). This equation has a general solution (theta)(t) = Acos(t - S) ... [A - amplitude and S - phase shift]... and all solutions to the linear approximation of (theta)'' + (theta) = 0 have the same period independent from amplitude. However when considering the initial conditions (theta)(0) = A and (theta)'(0)=0 investigate how the period depends on the amplitude by plotting A = 0.1, 0.7, 1.5, 3.0 for the second order nonlinear equation (theta)'' + sin(theta) = 0. Solve for the displacements at a sequnce of times and finding the time at which the pendulum returns to its original position and graph these results.
I need a matlab code to solve (theta)'' + sin(theta) = 0 with initial conditions (theta)(0) = 0.1, 0.7, 1.5, 3.0 and (theta)'(0) = 0
and a code to graph all 4 of these second order equation solutions on the same graph
Explanation / Answer
PLEASE RATE THE ANSWER POSITIVELY FOR SHOWING THE WORK
create the following function file and save is as F.m
function thetap =F(t,theta)
thetap=zeros(2,1);
thetap(1)=theta(2);
thetap(2)=-sin(theta(1))
Next ,
create a new file in the same folder with the following code and run it
[t,theta]=ode45('F',[0 20],[0.1 0]) ; % first braket contains how much time the solution should be computed
[t1,theta1]=ode45('F',[0 20],[0.7 0]) ;
[t2,theta2]=ode45('F',[0 20],[1.5 0]) ;
[t3,theta3]=ode45('F',[0 20],[3 0]) ;
figure
plot(t,theta)
hold on
plot(t,theta1)
hold on
plot(t,theta2)
hold on
plot(t,theta3)
hold off
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.