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

Problems with applying algorithms , PROBLEMS WITH APPLYING ALGORITHMS :  F...

PROBLEMS WITH APPLYING ALGORITHMS :  From your experience, you would agree that children are expected to mechanically apply the algorithms for adding or subtracting numbers, regar

Find how much women prefer a job outside of the home, According to a Gallup...

According to a Gallup poll 51% of US women prefer to have a job outside of the home. What is the chance that a survey of 200 women would find that 45% or less of the respondants

Division of complex number, Division of complex number Now, we gave thi...

Division of complex number Now, we gave this formula a long with the comment that it will be convenient while it came to dividing complex numbers so let's look at a couple of e

Find the number of students in the class, Students are made to stand in row...

Students are made to stand in rows. If one student is extra in a row there would be 2 rows less. If one student is less in a row there would be 3 rows more. Find the number of stud

What is probability that a person selected at random eyes, If 65% of the po...

If 65% of the populations have black eyes, 25% have brown eyes and the remaining have blue eyes. What is the probability that a person selected at random has (i) Blue eyes (ii) Bro

Perimeter, what is the perimeter of a rhombus

what is the perimeter of a rhombus

Calculate the limit of f (-4), Let's take a look at one more example to ens...

Let's take a look at one more example to ensure that we've got all the ideas about limits down that we've looked at in the last couple of sections. Example: Given the below gr

Probability, two coins are flipped once.what is the probability of getting ...

two coins are flipped once.what is the probability of getting two tails?

Pre-calculus, finding the vertex for the function of the form f(x)=ax^2+bx...

finding the vertex for the function of the form f(x)=ax^2+bx+c

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