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

Two tailed tests, Two Tailed Tests A two tailed test is generally used ...

Two Tailed Tests A two tailed test is generally used in statistical work as tests of significance for illustration, if a complaint lodged by the client is about a product not m

Vector functions - three dimensional space, Vector Functions We very f...

Vector Functions We very firstly saw vector functions back while we were looking at the Equation of Lines. In that section we talked about them as we wrote down the equation o

Advantages and disadvantages of decision trees, Advantages of decision tree...

Advantages of decision trees 1. This clearly brings out implicit calculations and assumptions for all to see question and revise 2. This is simple to understand Disadvan

Surds and logarithms, what are these all about and could i have some exampl...

what are these all about and could i have some examples of them please

Prove that one of three consecutive integers divisible by 3, Prove that one...

Prove that one of every three consecutive integers is divisible by 3. Ans: n,n+1,n+2 be three consecutive positive integers We know that n is of the form 3q, 3q +1, 3q +

how large a sample is necessary to have a standard error, If the populatio...

If the population standard deviation is o=8, how large a sample is necessary to have a standard error that is: a.  less than 4 points? b.  less than 2 points? c.  less than 1 poin

Combined mean and standard deviation, Combined Mean And Standard Deviation ...

Combined Mean And Standard Deviation Occasionally we may need to combine 2 or more samples say A and B. Therefore it is essential to identify the new mean and the new standard

Give an equations with the variable on both sides, Give an Equations with t...

Give an Equations with the variable on both sides ? Many equations that you encounter will have variables on both sides. Some of these equations will even contain grouping sy

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