6. Consider the initial value problem
y' = ty^2 + y, y(0) = 0.25,
with (exact) solution y(t).
(a) Verify that the solution of the initial value problem is
y(t) = 1/(3e^(-t) − t + 1)
and evaluate y(1) to at least four decimal places.
(b) Use Euler’s method to approximate y(1), using a step size of h = 0.5, and evaluate the difference between y(1) and the Euler’s method approximation.
(c) Use MATLAB to implement Euler’s method with each step size
i. h = 0.25, ii. h =, 0.125, iii. h = 0.0625,
all for 0 ≤ t ≤ 1 and plot the exact solution from part (a) and the three Euler’s method results for this part in a single figure. Include a title and a legend. Save the figure as hw1q6c.fig. Record the numerical values of each of the three Euler’s method approximations of y(1), to be used in part (d). Use the function euler provided in the file euler.m.
(d) Let yn[h] denote the result of Euler’s method after n steps of size h. Calculate (by hand, or use MATLAB and write down the results) the errors
i. E4[0.25] = y(1) − y4[0.25], ii. E8[0.125] = y(1) − y8[0.125], iii. E16[0.0625] = y(1) − y16[0.0625].
Notice that the sign of the error En[h] (nh = 1) tells us if the Euler’s method approximation is less than, or greater than, the exact value y(1). From your calculations i.–iii., which Euler’s method approximation of y(1) from part (c) is determined to be the most accurate (has the least absolute value |En[h]|)? Guess what the error E32[0.03125] = y(1) − y32[0.03125] would be, approximately.
6.) (a) Solve the Differential equation.
Step 1.) First, solve the Differential Equation the put the value of t = 0 in the following finding.
Divide the above equation with y2.
Substitute,
On differentiate we get,
Substitute the equation (2) in equation (1).
The above equation become,
Now, the above equation is a linear first-order ordinary differential equation.
It can be solved by using the integrating factor.
Equation (3) is in the form of
P(t) = 1, Q(t) = -t
Find the Integrating factor.
P(t) = 1
By using Integrating factor we can solve the required differential as,
The solution of the above linear first-order ordinary differential equation
Now by substituting the value on the above solution, we get,
On solving the above integration we get,
Substitute back the value of v, we get,
Step 2.) By using the initial value
we get,
Solution becomes,
At t = 1, we get
Get Answers For Free
Most questions answered within 1 hours.