Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve using Matlab Task 2: Solving Differential Equations using Heun's, Midpoint methods [25 marks] (a) Write a function that uses the Heun's method to

Please solve using Matlabimage text in transcribed

Task 2: Solving Differential Equations using Heun's, Midpoint methods [25 marks] (a) Write a function that uses the Heun's method to find y(t) with a step size h, tspan, and initial value yO an inputs. Your function should start as follows: function [t,ylheun (dydt, tspan, yo,h) (b) Write a function that uses the Midpoint method to find y(t) with a step size h, tspan, and initial value y0 an inputs. Your function should start as follows function It, y) - midpoint (dydt,tspan, y0,h) (c) Write an M-file that calculates the y(4) using Heun's method, Midpoint method for step size of h-1, 0.5, and 0.25 with an initial condition y(0)-2. Create 3 subplots that contain the graphs of the Heun's method (use blue line and dot markers), Midpoint method (use green line) and ODE45 plot (use red circle markers) for each step size h. Label your plots accordingly. Hint: Use ODE from Task 1 and use the functions from part (a) and (b)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Create messages that solve problems

Answered: 1 week ago