Sie sind auf Seite 1von 2

Analytical Methods in Engineering ElecEeng 234 Section 402 Fall of 2013 (Semester I, 2013 2014) Due: December 4, 2013

3 (6PM) Project II This project consists of two parts. Your project report should be turned in to your TA using dropbox in d2l or on paper. Part I (20 points) Solution of 2nd Order Homogeneous Differential Equations of the form: d2y dy + a + by = r (t ) 2 dt dt Creating a 2nd Order Function in Matlab Under the File Pulldown Menu Select New > mfile(a new window will appear) Enter the following function into this file and save it function dydt = order2(t,y) dydt = zeros(size(y)); a = 4.0; %coefficient for y term b = -2.0; %coefficient for y term r = 0.0; %forcing function dydt(1) = y(2); dydt(2) = r -a*y(2) - b*y(1); Explanation of above function
dy term dt b is the coefficient for y term r is the right hand side (forcing function) which is equal to 0 in this case dydt(1) = y(2) (let y = y(1) , y = y(2)) dydt(2) = r -a*y(2) - b*y(1); (solve for y(2) in terms of r, y and y terms) Note: we have converted a 2nd order ODE to two 1st order ODEs.

a is the coefficient for

In the Matlab window enter the following lines >> tspan = [0 2]; >> y0 = [4,-5]; >> [t,y]=ode45('order2',tspan,y0); >> plot(t,y(:,1)) tspan provides the range of the time. y0 provides the initial conditions with its first element = y(0), second element = y(0) ode45 is a Matlab routine which solves the ordinary differential equation. The routine gives discrete values of y for each value of t. These results are then plotted.

Compare your Matlab figure to Fig. 30 on page 55 of your text [Fig. 29 on page 54 of 9th Ed. text]. Notice that the damping coefficient is four times of that of Fig. 30 [Fig. 29 in 9th Ed. of text]. Open a word document and type your name at the top of the file. Copy your m file and Matlab figure into it and type your comments for your observation, Change the initial conditions in y0. Repeat the final 2 Matlab commands from above. Observe how the plots change. Add the plots with y0 = [4,1] and y0 = [-3,1] along with comments for your observations to the word document and send it to the TA. Save your m-file. You will be modifying this file in the next part. Part II (20 points) 1. Modify your prior code and save the new m-file after modifications, then set d2y dy + 3.6 + 3.24 y = 10te 1.8t with y (0) = 1, y (0) = 0 . tspan = [0 10] and solve: 2 dt dt Compare your Matlab figure to Fig. 51 on page 83 of your text [Fig. 50 on page 82 of 9th Ed. text]. Open a new word document and type your name at the top of the file and copy your m file and Matlab figure into it and type your observation. 2. Resonance

d2y dy + c + ky = r (t ) where 2 dt dt m = 0.1, k = 1.257, with initial conditions y (0) = 1 and y (0) = 2 . Also let
Given an equation of the form m
r (t ) = cos( *t ) and set tspan = [0 80] where * =

k c2 . Notice that m 4m 2

x y

is sqrt(x/y) in Matlab. Modify your prior code and run your program several times with the following values for c and r(t) (copy the m file and figure of this run to the word file created in 1. of part 1I): a) c=1 and use the same r(t) b) c=0.1 and use the same r(t) c) c=.04 and use the same r(t) d) c=.04 and change r (t ) = cos( 0.9 *t ) , i.e. detuning the input frequency 10% away from the resonant frequency. Compare to Figs. 5557 (on page 8891) [Figs. 5456 in 9th Ed. of the text (on page 8790)], do you see the trend indicated by these figures? Put your comments in the word file and then send it to the TA. Note: Save the m-file after modifications of ODE parameters such as coefficients and r(t) each time. Open a new word document and type your name at the top of the file. Copy your m file and Matlab figure into it and type your observation for each part.

Das könnte Ihnen auch gefallen