2. Consider the IVP for 0 t6. y=-3.8y, y(0) = 1 The exact solution of this...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Consider the IVP for 0 ≤t≤6. y=-3.8y, y(0) = 1 The exact solution of this IVP is y = e−3.8t The goal of this exercise is to visualize how Euler's method is related to the slope field of the differ- ential equation. In order to do this we will plot the direction field together with the approximations and the exact solution. (a) To plot the slope field we will use the MATLAB commands meshgrid and quiver. Enter the following commands: t = 0:0.4:6; y = -11:2.4:13; %define a grid in t & y directions = [T, Y] meshgrid (t, y); dT = ones (size (T)); dY -3.8*Y; quiver (T, Y, dT, dY) axis tight hold on % create 2d matrices of points in ty-plane %dt 1 for all points %dy = -3.8*y; this is the ODE % draw arrows (t, y)->(t+dt, t+dy) %adjust look After running these commands you should get the graph of the slope field. (b) Use linspace to generate a vector of 100 t-values between 0 and 6. Evaluate the (ex- act) solution y at these t-values and plot it in black together with the direction field (use 'linewidth', 2). (c) Enter the function defining the ODE as anonymous. Use euler.m with N = 10 to determine the approximation to the solution. Plot the approxi- mated points in red (use 'ro-', 'linewidth',2 as line-style in your plot), together with the exact solution and the direction field. You should get Figure 2. The legend is not required, but to produce it, you can use legend ('Slope Field', 'Exact Sltn', 'Approx. Sltn (N=10)', 'location', 'northwest'); Based on the slope field and the geometrical meaning of Euler's method explain why the ap- proximations are so inaccurate for this particular value of the stepsize. Sope Fil for E-35 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ + ++ + THT T PT TT TT TT TTTTTTT D T 2 3 Figure 2: Euler's method applied to y' = -3.8y, y(0) = 1, N = 10 compared to the exact solution. (d) Open a new figure by typing figure. Plot again the direction field but in a different window: t = 0:0.4:6; y = -0.6:0.2:1.3; Repeat part (b) and repeat part (c) but this time with N = 20. You should get Figure 3. Because of the different scaling of the y-axis, the exact solution (black curve) looks a bit different, but it is the same curve as in the previous figure. Comment on the result from a geometrical point of view. DE 04 02 == Figure 3: Euler's method applied to y' = -3.8y, y(0) = 1, N = 20, compared to the exact solution. 2. Consider the IVP for 0 ≤t≤6. y=-3.8y, y(0) = 1 The exact solution of this IVP is y = e−3.8t The goal of this exercise is to visualize how Euler's method is related to the slope field of the differ- ential equation. In order to do this we will plot the direction field together with the approximations and the exact solution. (a) To plot the slope field we will use the MATLAB commands meshgrid and quiver. Enter the following commands: t = 0:0.4:6; y = -11:2.4:13; %define a grid in t & y directions = [T, Y] meshgrid (t, y); dT = ones (size (T)); dY -3.8*Y; quiver (T, Y, dT, dY) axis tight hold on % create 2d matrices of points in ty-plane %dt 1 for all points %dy = -3.8*y; this is the ODE % draw arrows (t, y)->(t+dt, t+dy) %adjust look After running these commands you should get the graph of the slope field. (b) Use linspace to generate a vector of 100 t-values between 0 and 6. Evaluate the (ex- act) solution y at these t-values and plot it in black together with the direction field (use 'linewidth', 2). (c) Enter the function defining the ODE as anonymous. Use euler.m with N = 10 to determine the approximation to the solution. Plot the approxi- mated points in red (use 'ro-', 'linewidth',2 as line-style in your plot), together with the exact solution and the direction field. You should get Figure 2. The legend is not required, but to produce it, you can use legend ('Slope Field', 'Exact Sltn', 'Approx. Sltn (N=10)', 'location', 'northwest'); Based on the slope field and the geometrical meaning of Euler's method explain why the ap- proximations are so inaccurate for this particular value of the stepsize. Sope Fil for E-35 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ + ++ + THT T PT TT TT TT TTTTTTT D T 2 3 Figure 2: Euler's method applied to y' = -3.8y, y(0) = 1, N = 10 compared to the exact solution. (d) Open a new figure by typing figure. Plot again the direction field but in a different window: t = 0:0.4:6; y = -0.6:0.2:1.3; Repeat part (b) and repeat part (c) but this time with N = 20. You should get Figure 3. Because of the different scaling of the y-axis, the exact solution (black curve) looks a bit different, but it is the same curve as in the previous figure. Comment on the result from a geometrical point of view. DE 04 02 == Figure 3: Euler's method applied to y' = -3.8y, y(0) = 1, N = 20, compared to the exact solution.
Expert Answer:
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
Consider the following Poisson's equation with homogeneous Dirichlet boundary condition: { u(x, y) = 22 sin(x) sin(y), (x, y) = (0, 1) (0, 1), u(x, y) = 0, on (1) The exact solution of this...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
As a security architect for a medium-sized firm, briefly describe how would you approach the following case problems: 1. Sending encrypted email to third parties. 2. Encrypting sensitive data inside...
-
Describe, in general terms, why Congress implemented the AMT.
-
Kim Harris owns and operates a small retail store, selling the outdoor clothing of an American manufacturer to a predominantly college-student market. Lately, a large department store outside of town...
-
How can management mitigate the likelihood of department managers processing payroll checks for terminated employees or processing unauthorized promotions and transfers?
-
Presented below is a combined single-step income and retained earnings statement for Hardrock Mining Co. for 2017. Statement of Income and Retained Earnings for the Year Ended December 31, 2017 ($ in...
-
Whole Foods Market is the leading natural and organic foods supermarket, the first national "Certified Organic" grocer. The company incorporated in 1978, opened the first Whole Foods Market store in...
-
Run Project management database Run 4 tables based on the diagram below Include all of constraints based on the ERD diagram and based on your assumptions Include primary key and foreign key Use...
-
In the United States, the post-pandemic era has brought unprecedented problems, including an increasing demand for workers to restore the economy. As citizens have become lethargic about going to...
-
If the current value of GDP is $22.42 trillion and the government is planning to make transfers to people $1.4 trillion (all in one year), the percentage increase in GDP using the multiplier estimate...
-
Typically, a smartphone is used by a single person, and carried on the body more or less permanently. It is therefore seen as very personal and private device, which one would not want to hand to...
-
You own shares of the High Growth Technology Fund, which has a NAV of $57.78 and a 4.88 percent back-end load. How much will you receive per share upon redemption?
-
What is the gain or loss on a $15,000 bond sold at 199.5 to yield 11%, compounded semi-annually, with 12% semi-annual coupons redeemable at 113 in 3 years?
-
Translate each of the following arguments into symbolic form using the variables given below. D= The drought will continue. S=We get an early storm. M= Managers of the ski areas will be happy. F =...
-
Assume you are the accountant for Catalina Industries. John Catalina, the owner of the company, is in a hurry to receive the financial statements for the year ended December 31, 20X1, and asks you...
-
In the 1970s, Disneyland charged an entrance fee to get into the park and then required customers to separately buy tickets for each ride once they were in the park. In the 1980s, Disneyland switched...
-
Exploring the Difference between Willingness to Pay and Willingness to Accept: Suppose you and I are identical in every way same exogenous income, same tastes over pizza and other goods. The only...
-
Annuities are streams of payments that the owner of an annuity receives for some specified period of time. The holder of an annuity can sell it to someone else who then becomes the recipient of the...
-
A stepped bar, fixed at \(x=0\) and free at \(x=l\), has a cross-sectional area of \(2 A\) for \(0 \leq x
-
Estimate the fundamental frequency for the longitudinal vibration of a uniform bar fixed at \(x=0\) and free at \(x=l\) by assuming the mode shapes as (a) \(U(x)=c_{1}(x / l)\) and (b) \(U(x)=c_{1}(x...
-
Estimate the fundamental frequency of a fixed-fixed string, assuming the mode shape (a) \(W(x)=c_{1} x(l-x)\) and (b) \(W(x)=c_{1} x(l-x)+c_{2} x^{2}(l-x)^{2}\).
Study smarter with the SolutionInn App