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

Coefficient of determination, Coefficient of Determination It refers t...

Coefficient of Determination It refers to the ratio of the explained variation to the total variation and is utilized to measure the strength of the linear relationship. The s

Example of addition, Example 1 Add 4x 4 + 3x 3 - ...

Example 1 Add 4x 4 + 3x 3 - x 2 + x + 6 and -7x 4 - 3x 3 + 8x 2 + 8x - 4 We write them one below the other as shown below.

Why did the two dice game become more difficult?, The following exercises m...

The following exercises may help you to look more closely at the activities done above. E1) Why did the two dice game become more difficult? E2) Do you find the activities in

Produce list containing m-vectors delta and lambda, The logarithm of the Po...

The logarithm of the Poisson mixture likelihood (3.10) can be calculated with the following R code: sum(log(outer(x,lambda,dpois) %*% delta)), where delta and lambda are m-ve

Permutation and combination, howmany numbers made by digit 0,1,2,3,5,7,9 bu...

howmany numbers made by digit 0,1,2,3,5,7,9 but any digit isnot repeted

Systems of linear equation, a man can row a bangka at a rate of 5 km/h in s...

a man can row a bangka at a rate of 5 km/h in still water. It takes 10 minutes longer to row upstream a distance of 2km than he takes to row downstream. What is the rate of the cur

What could the dimensions of the floor be in terms of x, Harold is tiling a...

Harold is tiling a rectangular kitchen floor with an area that is expressed as x 2 + 6x + 5. What could the dimensions of the floor be in terms of x? Because area of a rectang

Simple interest, find the simple interest on Rs. 68,000 at 50/3 per annum f...

find the simple interest on Rs. 68,000 at 50/3 per annum for 9 month

Applications of derivatives rate change, Application of rate change Bri...

Application of rate change Brief set of examples concentrating on the rate of change application of derivatives is given in this section.  Example    Find out all the point

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