Question: Consider the rst order initial value problem: dy dx = y + y ^ 2 ( sin ( x ) cos ( x ) )

Consider the rst order initial value problem:
dy
dx =y+y^2(sin(x)cos(x)),
y (0)=0.1
(a) Determine the exact solution of the given initial value problem (manually). Please show
all your working.
(b) Estimate the value of y (1) using Euler's Method with step size h =0.2(manually), correct
to 4 decimal places. Show all your working.
(c) Write a MATLAB function Euler1.m to solve the initial value problem
dy
dx =y+y2(sin(x)cos(x)),
y (0)= y0
numerically with Euler's method over the general interval x in [0,b] for the general initial
condition y(0)= y0, using n regularly spaced points for the x grid. The input variables for
Euler1 should be b, y0 and n. Your code should generate a plot of the solution y(x),while
automatically inserting the label y for the y-axis, the label x for the x axis, and the
title Numerical Solution of Question 1 for your plot.
Next, use your MATLAB function Euler1.m to generate and plot the numerical solution
of this initial value problem for the speci ed initial condition y(0)=0.1 over the interval
x in [0,2], using n =101 points in your x grid. Make sure to include the plot in your
submission.
(d) Using appropriate MATLAB commands, overlay a plot of the exact solution found in Part
(a) onto the plot obtained in Part (c). The curve for the exact solution should be a dashed
line in your plot.
(e) State whether the numerical solution found in Part (c) is an overestimate or underestimate
of the actual solution

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 Programming Questions!