Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(In Matlab) 2. The equation for the motion of a pendulum with small angles is where - angle of pendulum in radians A = initial
(In Matlab)
2. The equation for the motion of a pendulum with small angles is where - angle of pendulum in radians A = initial angle of pendulum in radians g - acceleration due to gravity, 9.81 m/s'2 L = length of pendulum, meters t - time, seconds Note that "t" is not under the square root sign The exercise has 2 parts, a function to calculate a set of angles and a script to call the function and plot the results. Here's the "recipe": 1. Write a function called pendulum_angle. It has 2 inputs. One is the length of the 2. In the function set the value of g to 9.81 and the value of theta0, the initial angle, to 3. Calculate the vector of angles theta using the equation. The output of the functioin 4. In a separate file write a script as follows: pendulum, called length. The other is a vector of time values, called time 0.1. These are "hard-wired" values, not inputs. is theta a. Prompt the user for the input value of the length of the pendulum, call the resulting variable mylength b. Create the time vector called mytime, setting it to the values 0 to 5 in increments of 0.05 c. Calculate the vector of angles by calling the function, calling the result anglesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started