(a) Modify the function ex_with_2eqs to solve the IVP (4) for 0 t 45 using the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(a) Modify the function ex_with_2eqs to solve the IVP (4) for 0 t 45 using the MATLAB routine ode45. Call the new function LAB04ex1. Let [t,Y] (note the upper case Y) be the output of ode45 and y and v the unknown functions. Use the following commands to define the ODE: function dYdt= f(t,Y) y=Y (1); v=Y (2); dYdt = [v; -6* sin(t)-6*v-2*y]; Plot y(t) and v(t) in the same window (do not use subplot), and the phase plot showing v vs y in a separate window. Add a legend to the first plot. (Note: to display v(t) = y(t), use 'v(t)=y'' (t)'). Add a grid. Use the command ylim ([-3.9,3.9]) to adjust the y-limits for both plots. Adjust the x-limits in the phase plot so as to reproduce the pictures in Figure 3 2 1 0 -1 www -2 -3 0 10 20 t y(t) v(t) 30 40 A-a 3 2 1 0 -1 -2 -3 -2 0 Y 2 Figure Time series y = y(t) and v=v(t) = y'(t) (left), and phase plot v = y' vs. y for (4). (b) By reading the matrix Y and the vector t, find (approximately) the last three values of t in the interval 0 t 45 at which y reaches a local maximum. Note that, because the M-file LAB04ex1.m is a function file, all the variables are local and thus not available in the Command Window. To read the matrix Y and the vector t, you need to modify the M-file by adding the line [t, Y(:,1), Y(:,2)]. Do not include the whole output in your lab write-up. Include only the values necessary to answer the question, i.e. just the rows of [t, y, v] with local y-maxima and the adjacent rows. To quickly locate the desired rows, recall that the local maxima of a differentiable function appear where its derivative changes sign from positive to negative. (Note: Due to numerical approximations and the fact that the numerical solution is not necessarily computed at the exact t-values where the maxima occur, you should not expect v(= y) to be exactly 0 at local maxima, but only close to 0). (c) What seems to be the long term behavior of y? (d) Modify the initial conditions to y(0) = 1.1, v(0) = -1.2 and run the file LAB04ex1.m with the modified initial conditions. Based on the new graphs, determine whether the long term behavior of the solution changes. Explain. Include the pictures with the modified initial conditions to support your answer. (a) Modify the function ex_with_2eqs to solve the IVP (4) for 0 t 45 using the MATLAB routine ode45. Call the new function LAB04ex1. Let [t,Y] (note the upper case Y) be the output of ode45 and y and v the unknown functions. Use the following commands to define the ODE: function dYdt= f(t,Y) y=Y (1); v=Y (2); dYdt = [v; -6* sin(t)-6*v-2*y]; Plot y(t) and v(t) in the same window (do not use subplot), and the phase plot showing v vs y in a separate window. Add a legend to the first plot. (Note: to display v(t) = y(t), use 'v(t)=y'' (t)'). Add a grid. Use the command ylim ([-3.9,3.9]) to adjust the y-limits for both plots. Adjust the x-limits in the phase plot so as to reproduce the pictures in Figure 3 2 1 0 -1 www -2 -3 0 10 20 t y(t) v(t) 30 40 A-a 3 2 1 0 -1 -2 -3 -2 0 Y 2 Figure Time series y = y(t) and v=v(t) = y'(t) (left), and phase plot v = y' vs. y for (4). (b) By reading the matrix Y and the vector t, find (approximately) the last three values of t in the interval 0 t 45 at which y reaches a local maximum. Note that, because the M-file LAB04ex1.m is a function file, all the variables are local and thus not available in the Command Window. To read the matrix Y and the vector t, you need to modify the M-file by adding the line [t, Y(:,1), Y(:,2)]. Do not include the whole output in your lab write-up. Include only the values necessary to answer the question, i.e. just the rows of [t, y, v] with local y-maxima and the adjacent rows. To quickly locate the desired rows, recall that the local maxima of a differentiable function appear where its derivative changes sign from positive to negative. (Note: Due to numerical approximations and the fact that the numerical solution is not necessarily computed at the exact t-values where the maxima occur, you should not expect v(= y) to be exactly 0 at local maxima, but only close to 0). (c) What seems to be the long term behavior of y? (d) Modify the initial conditions to y(0) = 1.1, v(0) = -1.2 and run the file LAB04ex1.m with the modified initial conditions. Based on the new graphs, determine whether the long term behavior of the solution changes. Explain. Include the pictures with the modified initial conditions to support your answer.
Expert Answer:
Answer rating: 100% (QA)
Solutions function dYdt ftY y Y1 v Y2 dYdt v cost4v3y end function ty LAB04ex1 ... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
Has the Medical-Surgical team applied the Lead User research process successfully? Why or why not?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
August 8, 2019, was a grim day at the San Francisco headquarters of Uber, the global leader in ride-hailing companies. That day it announced a staggering loss of $5.2 billion in just the previous 3...
-
Answer the following independent questions with respect to traditional IRA contributions for 2014: a. Juan, age 41, earns a salary of $28,000 and is not an active participant in any other qualified...
-
For the following exercises, perform the given matrix operations. det 7212 0 NI O 0
-
Moore, Corp., completed the following selected transactions and prepared these adjusting entries during May: Requirements 1.State whether the transaction would increase revenues, decrease revenues,...
-
Steve and Marie Venturini were involved in the operation of Steves Sizzling Steakhouse in Carlstadt, New Jersey, from the day their parents opened it in the 1930s. By the 1980s, Steve, Marie, and her...
-
Imagine your sister calls you and starts sharing the difficulty she is having at work with the team she is leading. Many members of her team are experiencing interpersonal conflict with each other...
-
The case of Michigan Basic Property Insurance Association v. Washington (MICHIGAN BASIC PROPERTY INSURANCE ASSOCIATION V. JOYCE WASHINGTON, CLEVELAND POWELL, COUNTRYWIDE HOME LOANS, DIMONTI &...
-
Which of the accounting elements (assets, liabilities, equity, income, expenses) you should be keep to be high and to be low or controlled and why?
-
Consider the following apportionment problem for College Town: Suppose each council member is to represent approximately 2,500 citizens. Use the apportionment plan requested in Problems 41-45...
-
The English enrollments at five high schools in the Santa Rosa Unified School District are as follows: In Problems 42-47, suppose that 45 copies of an important instructional video are to be...
-
Consider an election with three candidates with the following results: a. Is there a majority winner? If not, who is the plurality winner? b. Who wins the election using the Borda count method? c....
-
Twelve people serve on a board and are considering three alternatives: A, B, and C. Here are the choices followed by vote: Determine the winner, if any, using the voting methods in Problems 39-44....
-
Consider the following apportionment problem: Use the apportionment plan requested in Problems 51-55 assuming that there must be 16 representatives. Jefferson's plan North: 18,200 South: 12,900 East:...
-
The oxidation numbers of P, S, and Cl in HPO, HS, and KC1O4 are, respectively A) -1,-1, +3. D) -1, -2, +7. B) +1, -2, +7. E) -1, -2, +3. C) +1, +2, +7.
-
Refer to the data for problem 13-36 regarding Long Beach Pharmaceutical Company. Required: Compute each division's residual income for the year under each of the following assumptions about the...
-
Evaluate the integral. 2.x (1/2) xe fo (1 + 2x) Jo dx
-
Differentiate. f(x) = 1 xe x /x + e x
-
Calculate y. y = e 1/x /x 2
-
Covenant Trucking Company uses the units-of-production (UOP) depreciation method because UOP best measures wear and tear on the trucks. Consider these facts about one Mack truck in the company's...
-
PepsiCo, Inc., has acquired several other companies. Assume that PepsiCo purchased Kettle Chips Co. for \(\$ 8\) million cash. The book value of Kettle Chips' assets is \(\$ 12\) million (market...
-
The board of directors of Park Place Porsche is having a quarterly meeting. Accounting policies are on the agenda, and depreciation is being discussed. A new board member, an attorney, has some...
Study smarter with the SolutionInn App