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

probability problems, A school principal is looking at the combinations of...

A school principal is looking at the combinations of subjects students are studying. He learns that the probability that a student is studying Chemistry is 0.5 and that the prob

How many people said that red was their favorite color, In a recent survey ...

In a recent survey of 700 people, 15% said that red was their favorite color. How many people said that red was their favorite color? Find out 15% of 700 through multiplying 70

John 47 out of 86 free-throws who best free-throw shooter, Michael made 19 ...

Michael made 19 out of 30 free-throws this basketball season. Larry's freethrow average was 0.745 and Charles' was 0.81. John made 47 out of 86 free-throws. Who is the best free-th

Rate of change interpretation of derivative, Rate of Change : The first in...

Rate of Change : The first interpretation of derivative is rate of change.  It was not the primary problem which we looked at in the limit chapter, however it is the most signific

Sequences and series - calculus, Sequences and Series In this section ...

Sequences and Series In this section we will be taking a look at sequences and infinite series.  In fact, this section will deal approximately exclusively with series.  Though

Triangles, if A be the area of a right triangle and b be one of the sides c...

if A be the area of a right triangle and b be one of the sides containing the right angle, prove that the length of the altitude on the hypotenuse is 2Ab/rootb^4+4A^2

In terms of x what is the total number of miles they rode, Noel rode 3x mil...

Noel rode 3x miles on his bike and Jamie rode 5x miles on hers. In terms of x, what is the total number of miles they rode? The terms 3x and 5x are such as terms since they hav

Introduction to addition and subtraction, INTRODUCTION :  When a child of ...

INTRODUCTION :  When a child of seven isn't able to solve the sum 23+9, what could the reasons be? When she is asked to subtract 9 from 16, why does she write 9 - 16 = 13 ?

Congruences, Suppose m be a positive integer, then the two integer a and b ...

Suppose m be a positive integer, then the two integer a and b called congurent modulo m ' if a - b is divisible by m i.e.  a - b = m where is an positive integer. The congru

Evaluate the volume and surface area of a rectangular solid, Evaluate the v...

Evaluate the volume and surface area of a rectangular solid: Calculate the volume & surface area of a rectangular solid along with a =   3", b = 4", & c = 5".  Solution:

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