Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab Grader X Problem 4 - Plot a decaying cosine wave 4 solutions submitted (max: Unlimited) View my solutions Damped oscillations are commonly used to
Matlab Grader
X Problem 4 - Plot a decaying cosine wave 4 solutions submitted (max: Unlimited) View my solutions Damped oscillations are commonly used to describe physical systems such as mechanical vibrations and electrical circuits. The mathematical model used to describe a damped oscillation is a cosine multiplied by an exponentionally decaying amplitude of the form: y(t) = Ae-alcos (ot+0) where A is the initial amplitude with the same units as the physical quantity that is being modeled, a is the damping constant in units of inverse seconds, w is the radian frequency of the oscillation in radians/second, t is time in seconds, and is the phase shift in radians. The period T of the wave is related to the radian frequency by the formula T 21 Assume y(t) is a linear position measured in meters. Write a script that generates y-values for 200 equally spaced t-values spanning three periods of y(t) for a damped oscillation with the following parameter values: A = 10 m a= 0.25 -1 w = 1/2 rad/s . = 1/4 rad Assign the t values to a column vector variable tValues. Assign the y(t) values to a column vector variable yValues. Next use the plot command to generate a properly-labeled graph of y(t). Use MATLAB commands to add an appropriate title and axis labels to the figure. Solve this problem using vectorized code (i.e. use vectors and do not use a loop in your solution.) Assign the t values to a column vector variable tValues. Assign the y(t) values to a column vector variable yValues. Next use the plot command to generate a properly-labeled graph of y(t). Use MATLAB commands to add an appropriate title and axis labels to the figure. Solve this problem using vectorized code (i.e. use vectors and do not use a loop in your solution.) Script C Reset 10 MATLAB Documentation 1 A = 10; 2 a = 0.25; 3 omega = pi/2; 4 zhi = pi/4; 5 y =@(t)A. *exp(-a. *t). *cos(omega. *t+zhi); 6 T = 2*pi/omega; 7 tValues = [linspace(0.3*T,200)].'; 8 yValues = y(tValues); 9 hold on; 10 grid on; 11 plot(tValues, y Values); 12 title('Damping oscilation vs time'); 13 xlabel('Time(t)in seconds'); 14 ylabel('Amplitude'); 15 legend('y(t)')Step 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