Question

4. please help with both parts a and b

4. Consider the pendulum with friction modeled by the second order ODE: where θ is the angle the pendulum makes with the vert

0 0
Add a comment Improve this question Transcribed image text
Answer #1


So that 건 E ond dor%%Matlab code for Eulers forward clear all close all %all parameter value w-2; alpha 0.2; function for Euler equation solutithetalt) vs. t plot 0.8 0.6 0.4 0.2 0.2 -0.4 -0.6 0.8 dtheta(t)/dt vs. t plot 1.5 0.5 も 0.5

%%Matlab code for Euler's forward
clear all
close all
%all parameter value
w=2; alpha=0.2;

%function for Euler equation solution
f1=@(th1,th2,t) th2;
f2=@(th1,th2,t) -alpha*th2-w^2*th1;

%all step size
h=0.001;
%Initial conditions
th10=1;   %theta(0)|=0
th20=0;   %dtheta/dt|t=0=0.1
%initial t
t0=0;
%t end values
tend=5;
tn=t0:h:tend;

% Euler steps
th1_result(1)=th10;
th2_result(1)=th20;
t_result(1)=t0;

%loop for Euler step for finding the solution
for i=1:length(tn)-1
  
    t_result(i+1)= t_result(i)+h;
    th1_result(i+1)=th1_result(i)+h*double(f1(th1_result(i),th2_result(i),t_result(i)));
    th2_result(i+1)=th2_result(i)+h*double(f2(th1_result(i),th2_result(i),t_result(i)));
  
end

%Plotting numerical solution
figure(1)
plot(t_result,th1_result,'linewidth',2)
xlabel('t')
ylabel('theta(t)')
title('theta(t) vs. t plot')

figure(2)
plot(t_result,th2_result,'linewidth',2)
xlabel('t')
ylabel('dtheta(t)/dt')
title('dtheta(t)/dt vs. t plot')


%%%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%%%%

Add a comment
Know the answer?
Add Answer to:
4. Consider the pendulum with friction modeled by the second order ODE: where θ is the angle the ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 4. A pendulum is modeled by a mass that is attached to a t y...

    Problem 4. A pendulum is modeled by a mass that is attached to a t y weightless rigid rod. According to Newton's second law, as the 0-1 pendulum swings back and forth, the sum of the forces that are acting on the mass equals the mass times acceleration MASS ACCELERATION FREE BOOY de DIAGRAM DIAGRAM — RL dt mL 3D — тg sin(0) dt2 ma,-mê where L 1.25 m is the length of the pendulum, g = 9.81 m/s2 is...

  • 3. The motion of a 1DOF mass-spring-damper system (see Figure 1) is modeled by the following seco...

    3. The motion of a 1DOF mass-spring-damper system (see Figure 1) is modeled by the following second order linear ODE: dx,2 dt n dt2 (0) C dt where is the damping ratio an wn is the natural frequency, both related to k, b, and m (the spring constant, damping coefficient, and mass, respectively) (a) Use the forward difference approximations of (b) Using Δt andd to obtain a finite difference formula for x(t+ 2Δ) (like we did in class for the...

  • Fresh answer please. Thanks in advance. Consider the following pendulum that consists of a massless straight...

    Fresh answer please. Thanks in advance. Consider the following pendulum that consists of a massless straight rigid rod AOB with a point mass m attached at the top point B and a point massM attached at the bottom point A. The pendulum rotates without friction about point O and it is initially at vertical equilibrium. Two springs are attached at the top point B from one end and fixed at the other end. The springs are unstretched at t-0 and...

  • . Consider the Furuta pendulum system; See Figure1 on the next page. The angle of the...

    . Consider the Furuta pendulum system; See Figure1 on the next page. The angle of the horizontal arm is denoted θ1 and the angle of the pendulum fron the vertically upward line is denoted θ2. Their corresponding angular velocities are denoted θ| and 02, respectively. The kinetic energy K and the potential energy V of the system are given by Vo COS in terms of some mechanical parameters Io, 111, 12, 112, Vo of the system that have all positive...

  • I need help with c). Question 2 The simple pendulum, discussed in week 4 and lab session 4, has the equation of motion...

    I need help with c). Question 2 The simple pendulum, discussed in week 4 and lab session 4, has the equation of motion f0/dt2_0? sin θ 9-(g/L)I/2. with The total energy of the pendulum is constant during the motion, and is given by _mgL cos θ, wher dt is the angular speed of the motion in radians per second. Consider the simple pendulum with initial conditions θ(0) and u(0)-wi, 0 i.e. starting from the vertically down position with an initial...

  • I need help with C Question 2 The simple pendulum, discussed in week 4 and lab session 4, has the equation of motion f0...

    I need help with C Question 2 The simple pendulum, discussed in week 4 and lab session 4, has the equation of motion f0/dt2_0? sin θ 9-(g/L)I/2. with The total energy of the pendulum is constant during the motion, and is given by _mgL cos θ, wher dt is the angular speed of the motion in radians per second. Consider the simple pendulum with initial conditions θ(0) and u(0)-wi, 0 i.e. starting from the vertically down position with an initial...

  • A system is modeled by the following LTI ODE: ä(t) +5.1640.j(t) + 106.6667x(t) = u(t) where...

    A system is modeled by the following LTI ODE: ä(t) +5.1640.j(t) + 106.6667x(t) = u(t) where u(t) is the input, and the outputs yı(t) and yz(t) are given by yı(t) = x(t) – 2:i(t), yz(t) = 5ä(t) 1. Find the system's characteristic equation 2. Find the system's damping ratio, natural frequency, and settling time 3. Find the system's homogeneous solution, x(t), if x(0) = 0 and i(0) = 1 4. Find ALL system transfer function(s) 5. Find the pole(s) (if...

  • #5 is only I need in which we need to plot it on Matlab and I...

    #5 is only I need in which we need to plot it on Matlab and I don't know how to plot it. Project 1 A Vibration Insulation Problem Passive isolation systems are sometimes used to insulate delicate equipment from unwanted vibrations. For example, in order to insulate electrical monitoring equipment from vibrations present in the floor of an industrial plant, the equipment may be placed on a platform supported by flexible mountings resting on the floor. A simple physical model...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT