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

Melissa is four times if jim is y years old, Melissa is four times as old a...

Melissa is four times as old as Jim. Pat is 5 years older than Melissa. If Jim is y years old, how old is Pat? Start along with Jim's age, y, because he appears to be the young

Partitioning -types of word problems related to subtraction, Partitioning ...

Partitioning - an action of taking away or removing some objects, and finding out how many remain. (e.g., there were 15 toffees in this container, and 10 have been eaten. How many

Sin3? = cos2? find the most general values of ?, sin3θ = cos2θ find the mos...

sin3θ = cos2θ find the most general values of θ satisfying the equatios? sinax + cosbx = 0 solve ? Solution)  sin (3x) = sin(2x + x) = sin(2x)cos(x) + cos(2x)sin(x) = 2sin(x)cos(

Properties of vector arithmetic, Properties of Vector Arithmetic If v, ...

Properties of Vector Arithmetic If v, w and u are vectors (each with the same number of components) and a and b are two numbers then we have then following properties. v →

.fractions, what is the difference between North America''s part of the tot...

what is the difference between North America''s part of the total population and Africa''s part

Complex eigenvalues, It is the last case that we need to take a look at. Th...

It is the last case that we need to take a look at. Throughout this section we will look at solutions to the system, x?' = A x? Here the eigenvalues of the matrix A are compl

How to convert decimals to percentages, Q. How to Convert Decimals to Perce...

Q. How to Convert Decimals to Percentages? Ans. Remember that when you have a decimal number, the digits to the right of the decimal point have the following meaning:

Find out the total number of pounds of coffee purchased, Megan bought x pou...

Megan bought x pounds of coffee in which cost $3 per pound and 18 pounds of coffee at $2.50 per pound for the company picnic. Find out the total number of pounds of coffee purchase

Fractions, The bowling alley suggests selecting a ball that is 1/7 of the b...

The bowling alley suggests selecting a ball that is 1/7 of the bowlers weight. If the bowler weighs 84 pounds, how much should the bowling ball weigh?

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