Initial value problems, math, Mathematics

Assignment Help:
Write a Matlab function MyIVP that solves an initial-value problem (IVP) for a system of ordinary
differential equations (ODEs) of the form
x ?(t) = f (t, x(t)),
where f : R × Rn ? Rn is an arbitrary function with one one-dimensional input (for time t) and one n-dimensional input x, and n-dimensional output. The function should implement a Runge-Kutta formula (for example, the rk34 formula or the Dormand & Prince formula).
The initial value x0 is provided by the user of MyIVP. The first line of MyIVP (saved in a file MyIVP.m) should look like this
function [xend,t,xt]=MyIVP(f,x0,tspan,N) Inputs
• f: function defining the right-hand side of the ODE. f should accept two arguments: t (a number) and x (an n-dimensional vector). The function f should return an n-dimensional vector y (the time derivative). Typical calling sequence: y=f(t,x), returning the value of f at time t in position x.
• x0: initial value where integration starts from (n-dimensional vector).
• tspan: Starting time and end time for integration. Integration has to run from time t =tspan(1)
to time t =tspan(2).
• N: number of steps for integration. The integration stepsize h=(tspan(2)-tspan(1))/N should
be small.
Outputs
• xend: result of integration at t =tspan(2).
• t: vector of times at which intermediate values have been computed (this should have N + 1
entries).
• xt: intermediate values (n × (N + 1)-array). xt(:,k) should be the solution at t(k).
You can check the built-in variable nargout inside your function to see if the user wants to get three outputs or only the end value xend. If nargout==1 you don’t need to store the intermediate values.

Related Discussions:- Initial value problems, math

Algebra, sir i want to ask u a question and that is if we simplify this wha...

sir i want to ask u a question and that is if we simplify this what will be the answer.(9x-45z+6y-100z+5x)

Find the volume of a cylinder of radius r, Find the volume of a cylinder of...

Find the volume of a cylinder of radius r and height h. Solution : Here, as we mentioned before starting this illustration we actually don't require using an integral to get t

Facts regarding linear equations, To solve out linear equations we will mak...

To solve out linear equations we will make heavy use of the following facts. 1. If a = b then a + c = b + c for any c.  All it is saying that we can add number, c, to both sides

Minimum and maximum values, Minimum and Maximum Values : Several applicati...

Minimum and Maximum Values : Several applications in this chapter will revolve around minimum & maximum values of a function.  Whereas we can all visualize the minimum & maximum v

Estimate the area of this field in terms of x and y, Jonestown High School...

Jonestown High School has a soccer field whose dimensions can be expressed as 7y 2 and 3xy. What is the area of this field in terms of x and y? Since the area of the soccer ?e

What is median number of tries it took these participante, The operator of ...

The operator of an amusement park game remain track of how many tries it took participants to win the game. The subsequent is the data from the ?rst ten people: 2, 6, 3, 4, 6, 2, 8

Statistics, How many 4 digit numbers can be formed using the numbers: 1 – 7...

How many 4 digit numbers can be formed using the numbers: 1 – 7. Repeated numbers CAN NOT be used

Linear programming , A paper mill produces two grades of paper viz., X and ...

A paper mill produces two grades of paper viz., X and Y. Because of raw material restrictions, it cannot produce more than 400 tons of grade X paper and 300 tons of grade Y paper i

Parabola, If the point (a,2a) is an interior point of the region bounded by...

If the point (a,2a) is an interior point of the region bounded by the parabola y2=16x and the double ordinate through the focus then a belongs to

Determine the head loss, A 3 km pipe starts from point A end at point B ...

A 3 km pipe starts from point A end at point B Population = 3000 people Q = 300 L/day/person Roughness = cast ion pipe Length of the pipe = 3km Case 1 From A to B

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd