Question: LAB 0 6 ex 1 . m clear all; % this deletes all variables omega 0 = 3 ; c = 2 ; omega =

LAB06ex1.m
clear all; %this deletes all variables
omega0=3;c=2; omega =3.6;
param =[omega0, c, omega];
t0=0;yO=0;v0=0;YO=[y0;v0];tf=40;
options = odeset('AbsTol',1e-10,'relTol', 1e-10);
, options, param When executing this program we get the plot in Figure 1. and the following output in the
command window:
computed amplitude of forced oscillation =0.1217
theoretical amplitude =0.1217
Figure 1: Forced oscillation.
Lines 10-14 deserve some explanation. Line 10 defines a time t1 after which we think the
contribution of the first term in (2) has become negligible compared to the second term. This
depends of course on the parameter values, in particular c. With c=2 we obtain e-12ct~~
2.310-6 for t=13, so this is certainly small enough compared to the amplitude seen on
Figure 1. The index i of time values larger than t1 is then determined. The quantity Y(i,1)
refers to the values of y associated to times larger than t1 only. The computed amplitude is. simply half the difference between the max and the min values. This value is compared to the
theoretical value (3).
(a) What is the period of the forced oscillation? What is the numerical value (modulo
2) of the angle defined by (4)?
(b) In this question you are asked to modify the file LAB06ex1.m in order to plot the
complementary solution of (1), that is, the first term in (2). First define in the
file the angle (alpha) using (4), then evaluate the complementary solution yc by
subtracting the quantity Ccos(t-) from the numerical solution y. Plot the
resulting quantity. Does it look like an exponentially decreasing oscillation? Why or
why not? Include the modified M-file and the corresponding plot.
 LAB06ex1.m clear all; %this deletes all variables omega0=3;c=2; omega =3.6; param

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!