This is not a graded assignment but a part of a review I'm studying, please do not reject the question, and thank you in advance for your solution! My review problem is the attached image that isn't the graph! I have provided the info from the overall problem here: g is acceleration due to gravity, l is pendulum of length 10 cm and initial displacement theta of 10 degrees.   and here is my code solution for part b) as well as the attached graph for b's solution necessary to answering my particular question:    % Given parameters initial_displacement = 10; % in degrees pendulum_length = 0.1; % in meters (10 cm) gravity = 9.81; % acceleration due to gravity in m/s^2 time_points = 100; time_axis = linspace(0, 1, time_points); % Time axis from 0 to 1 seconds   % Convert initial displacement to radians initial_displacement_rad = deg2rad(initial_displacement);   % Calculate angular displacement as a function of time angular_displacement =round(initial_displacement_rad * cos(sqrt(gravity/pendulum_length) * time_axis),4);   % Find times when angular displacement is maximum and minimum [max_displacement, max_ind] = max(angular_displacement); [min_displacement, min_ind] = min(angular_displacement); max_indices=(angular_displacement==max_displacement); min_indices=(angular_displacement==min_displacement); % Convert indices to time values and round to 4 digits time_at_max_displacement = time_axis(max_indices); time_at_min_displacement = time_axis(min_indices); max_displacement = round(max_displacement, 4); min_displacement = round(min_displacement, 4);   % Plotting plot(time_axis, angular_displacement, 'b-', 'LineWidth', 2); hold on; plot(time_at_max_displacement, max_displacement, 'ro', 'MarkerSize', 8, 'MarkerFaceColor', 'r'); hold on; plot(time_at_min_displacement, min_displacement, 'go', 'MarkerSize', 8, 'MarkerFaceColor', 'g'); xlabel('Time (s)'); ylabel('Angular Displacement (rad)'); title('Angular Displacement of Simple Pendulum'); legend('Angular Displacement', 'Max Displacement','Max Displacement', 'Min Displacement'); fprintf("The Number of times angular displacement is maximum : %d\n",sum(max_indices));   fprintf("The Number of times angular displacement is minimum : %d\n",sum(min_indices)); grid on; hold off;   Thank you, I'm really stuck on this one and my test is coming up and I would like to know how to solve properly!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

This is not a graded assignment but a part of a review I'm studying, please do not reject the question, and thank you in advance for your solution!

My review problem is the attached image that isn't the graph!

I have provided the info from the overall problem here:

g is acceleration due to gravity,

l is pendulum of length 10 cm

and initial displacement theta of 10 degrees.

 

and here is my code solution for part b) as well as the attached graph for b's solution necessary to answering my particular question:

 

 % Given parameters

initial_displacement = 10; % in degrees

pendulum_length = 0.1; % in meters (10 cm)

gravity = 9.81; % acceleration due to gravity in m/s^2

time_points = 100;

time_axis = linspace(0, 1, time_points); % Time axis from 0 to 1 seconds

 

% Convert initial displacement to radians

initial_displacement_rad = deg2rad(initial_displacement);

 

% Calculate angular displacement as a function of time

angular_displacement =round(initial_displacement_rad * cos(sqrt(gravity/pendulum_length) * time_axis),4);

 

% Find times when angular displacement is maximum and minimum

[max_displacement, max_ind] = max(angular_displacement);

[min_displacement, min_ind] = min(angular_displacement);

max_indices=(angular_displacement==max_displacement);

min_indices=(angular_displacement==min_displacement);

% Convert indices to time values and round to 4 digits

time_at_max_displacement = time_axis(max_indices);

time_at_min_displacement = time_axis(min_indices);

max_displacement = round(max_displacement, 4);

min_displacement = round(min_displacement, 4);

 

% Plotting

plot(time_axis, angular_displacement, 'b-', 'LineWidth', 2);

hold on;

plot(time_at_max_displacement, max_displacement, 'ro', 'MarkerSize', 8, 'MarkerFaceColor', 'r');

hold on;

plot(time_at_min_displacement, min_displacement, 'go', 'MarkerSize', 8, 'MarkerFaceColor', 'g');

xlabel('Time (s)');

ylabel('Angular Displacement (rad)');

title('Angular Displacement of Simple Pendulum');

legend('Angular Displacement', 'Max Displacement','Max Displacement', 'Min Displacement');

fprintf("The Number of times angular displacement is maximum : %d\n",sum(max_indices));

 

fprintf("The Number of times angular displacement is minimum : %d\n",sum(min_indices));

grid on;

hold off;

 

Thank you, I'm really stuck on this one and my test is coming up and I would like to know how to solve properly!

 

Use your results from part (b) to compute the time period of the pendulum oscillation.
Compare your answer with the theoretical expectation (To = 2πt
D.
Transcribed Image Text:Use your results from part (b) to compute the time period of the pendulum oscillation. Compare your answer with the theoretical expectation (To = 2πt D.
Figure 1
File Edit View Insert Tools Desktop Window Help
US
B
Angular Displacement (rad)
0.2
0.15
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
0
0.1
Angular Displacement of Simple Pendulum
N
0.2
0.3
0.4
0.5
Time (s)
0.6
0.7
0.8
Angular Displacement
Max Displacement
Max Displacement
● Min Displacement.
0.9
1
I
X
Transcribed Image Text:Figure 1 File Edit View Insert Tools Desktop Window Help US B Angular Displacement (rad) 0.2 0.15 0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 0 0.1 Angular Displacement of Simple Pendulum N 0.2 0.3 0.4 0.5 Time (s) 0.6 0.7 0.8 Angular Displacement Max Displacement Max Displacement ● Min Displacement. 0.9 1 I X
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Processes of 3D Graphics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education