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...
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
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 what the AMT exemption is and who is and isn't allowed to deduct the exemption. How is it similar to the standard deduction and how is it dissimilar?
-
Refer to the IEEE International Conference on Web Intelligence and Intelligent Agent Technology (2010) study of how social media (e.g., Twitter.com) may influence the products consumers buy, Exercise...
-
Follow the steps below to prove the LLN without using CLT. (a) Let \(X\) be a random variable with mean \(\mu\) and variance \(\sigma^{2}\). Then for any real number \(\alpha>0,...
-
The Balcar Companys auditors are developing an audit plan to review the companys systems development procedures. Their audit objectives are to ensure that 1. The system was judged necessary and...
-
Change Janets Schedule In Question 5 Above, You Calculated What The Schedule Would Look Like If Janet Had Made One $285.05 Payment In January 2022. You Did It By Hand, But The Bankrate Calculator Has...
-
If a contractual relationship grows such that the buyer wants to purchase additional items from the seller and the seller wants to sell such additional items to the buyer, which form of agreement...
-
The bonding in the square-planar ion E 4 2+ is described. Explore this proposition in more detail by carrying out computations, using software of your choice, on S 4 2+ with SS bond distances of 200...
-
Go to mymanagementlab.com for Auto-graded writing questions as well as the following Assisted-graded writing questions: 1. Explain the similarities and differences between merit pay, incentive pay,...
-
Graph a Gaussian and Lorentzian function with the same width at half the maximum intensity and comment on the essential difference between the two. What is the second moment in each case?
-
What is the likely range of the Hill constant for the hemoglobin described in Problem 23? Data from in Problem 23 Some primitive animals have a hemoglobin that consists of two identical subunits....
-
By what percent did the cost of goods and services change between December 2013 and June 2014?
-
The Wham-O air blaster fires a puff of air at about 6 meters per second and has a range of about 7 meters. Since a puff of air isnt a rigid object it disperses as it travels. How does the center of...
-
On October 31 Juanita Ortega, owner of Outback Guide Service, received a bank statement dated October 30. Juanita found the following: 1. The checkbook has a balance of $2,551.34. 2. The bank...
-
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...
-
For the probability distribution in Exercise 14, find the sampling distribution of the sample mean for all samples of size \(n=2\). (Hint: The sample means will be the same as given in Figure 3.7,...
-
Minitab can also be used to create a graphical summary of a given variable. The graphical summary can be found by selecting the Stat menu; under Basic Statistics a. Using Minitab, create a graphical...
-
Often we may be interested in comparing the amount of variability between two different data sets. This can be done using the sample coefficient of variation \((C O V)\), which is a percentage that...
Study smarter with the SolutionInn App