Matlab need code Q. 4. Attach screenshot

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Matlab need code Q. 4.

Attach screenshot 

 

 

-1. Pendulum Oscillation Modelling
Consider the pendulum and with a length / and a mass m (Figure 1). Using equilibrium of forces in the
polar system, the Ordinary Differential Equation (ODE) that describes the system can be written
as shown in Eq. 1.
Figure 4. Free body diagram of a simple pendulum
EM = I,a = -mgr sin 8 = lga = -mgr sin 8 = (I + mr).
dt
mgr
sin e
(la + mr2)
(1)
dt2
where m is the mass of the pendulum, g is gravity, r is the distance from the pivot point to the centre of
gravity of the pendulum (rod), and Iç is the moment of inertia about the centre of gravity.
Based on this mathematical model of the pendulum:
Q1. Find the equivalent system of two ordinary differential equations (ODE) based on the second
order differential equation given in Eq. 1. Use the specifications for the real pendulum
(Figure 2), which are given in the Table 2.
Table 2. Pendulum specifications
Mass (kg)
Length (m)
Distance from pivot point to centre of gravity (r) (m)
Moment of inertia about centre of gravity (L) (kg m)
0.1270
0.3365
0.1778
1.2000E-3
Q2. Develop an algorithm for the Runge-Kutta 44.order method in Matlab (See definition
at the end of this document). Solve the nonlinear ODE numerically with the same five 8,
amplitudes. Simulate the pendulum for 8s with a time step of h = 0.1s. Include your code as
an Appendix in your report.
Q3. Plot the velocities and for all five "0 amplitudes that resulted using the ODE (umerical method)
and the experimental trials (d.mat). Comment the results.
Transcribed Image Text:-1. Pendulum Oscillation Modelling Consider the pendulum and with a length / and a mass m (Figure 1). Using equilibrium of forces in the polar system, the Ordinary Differential Equation (ODE) that describes the system can be written as shown in Eq. 1. Figure 4. Free body diagram of a simple pendulum EM = I,a = -mgr sin 8 = lga = -mgr sin 8 = (I + mr). dt mgr sin e (la + mr2) (1) dt2 where m is the mass of the pendulum, g is gravity, r is the distance from the pivot point to the centre of gravity of the pendulum (rod), and Iç is the moment of inertia about the centre of gravity. Based on this mathematical model of the pendulum: Q1. Find the equivalent system of two ordinary differential equations (ODE) based on the second order differential equation given in Eq. 1. Use the specifications for the real pendulum (Figure 2), which are given in the Table 2. Table 2. Pendulum specifications Mass (kg) Length (m) Distance from pivot point to centre of gravity (r) (m) Moment of inertia about centre of gravity (L) (kg m) 0.1270 0.3365 0.1778 1.2000E-3 Q2. Develop an algorithm for the Runge-Kutta 44.order method in Matlab (See definition at the end of this document). Solve the nonlinear ODE numerically with the same five 8, amplitudes. Simulate the pendulum for 8s with a time step of h = 0.1s. Include your code as an Appendix in your report. Q3. Plot the velocities and for all five "0 amplitudes that resulted using the ODE (umerical method) and the experimental trials (d.mat). Comment the results.
Q4. Solve the above equations using Runge-Kutta 2nd -order method in the Matlab.
Qs. Also, solve this problem using Euler's method in Matlab.
Q6. Similar to the requirements in Q3, plot the velocities by using the methods in Q4 and Q5.
And then discuss the similarities and differences by comparing 3 different methods that you
used to solve the problem above, and in the end make a conclusion which one is the best
method based on your own analysis and understanding.
Reference:
Definition of Runge-Kutta 4*-order method for 2 order ODE:
dx
dx
= f(t, x, v).
dt
=v, x(t) = Xạ, v(t) = v%
dt
ti+1 = +h,
h = stepsize
dx, = hxv,
dv, = hxf(t, X, v)
dx = h
dr, = (v, +dv.)
dv, = hxf (1, +h.x, +ds, w +dv.)
dx, = h(v + dv,)
dv, = hxf(t, + h, xạ + dx3, Vị + dv,)
X+1 = x, +(dx, + 2dx, + 2dx, + dx,)
vio = v, + (dv, + 2dv, + 2dv, + dv.)
Transcribed Image Text:Q4. Solve the above equations using Runge-Kutta 2nd -order method in the Matlab. Qs. Also, solve this problem using Euler's method in Matlab. Q6. Similar to the requirements in Q3, plot the velocities by using the methods in Q4 and Q5. And then discuss the similarities and differences by comparing 3 different methods that you used to solve the problem above, and in the end make a conclusion which one is the best method based on your own analysis and understanding. Reference: Definition of Runge-Kutta 4*-order method for 2 order ODE: dx dx = f(t, x, v). dt =v, x(t) = Xạ, v(t) = v% dt ti+1 = +h, h = stepsize dx, = hxv, dv, = hxf(t, X, v) dx = h dr, = (v, +dv.) dv, = hxf (1, +h.x, +ds, w +dv.) dx, = h(v + dv,) dv, = hxf(t, + h, xạ + dx3, Vị + dv,) X+1 = x, +(dx, + 2dx, + 2dx, + dx,) vio = v, + (dv, + 2dv, + 2dv, + dv.)
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY