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

Compute the quartile coefficient of skewness, By using the above data compu...

By using the above data compute the quartile coefficient of skewness Quartile coefficient of skewness = (Q3 + Q1 - 2Q2)/(Q3 + Q1)                                The positio

Applications of rational numbers, Kaylee makes 56 packages in seven hours T...

Kaylee makes 56 packages in seven hours Taylor makes 20% more packages in nine hours who makes more packages per hour

Determine the volume of the object, A rectangular container is 15 cm wide a...

A rectangular container is 15 cm wide and 5 cm long, and contains water to a depth of 8 cm. An object is placed in the water and the water rises 2.3 cm. Determine the volume of the

Discrete mathmatics, give an example of a relation R that is transitive whi...

give an example of a relation R that is transitive while inverse of R is not

Marginal cost & cost function, Marginal cost & cost function  The cost ...

Marginal cost & cost function  The cost to produce an additional item is called the marginal cost and as we've illustrated in the above example the marginal cost is approxima

Find the volume of the liquid , A vessel in shape of a inverted cone is sur...

A vessel in shape of a inverted cone is surmounted by a cylinder has a common radius of 7cm this was filled with liquid till it covered one third the height of the cylinder. If the

Order to solve mathematical operations, Order to solve Mathematical Operati...

Order to solve Mathematical Operations: Example: Solve the following equation: (4 - 2) + (3 x 4) - (10 ÷ 5) - 6 =  ____________ Solution: a.         Perform ma

What are the average total repair costs per month, An automobile manufactur...

An automobile manufacturer needs to build a data warehouse to store and analyze data about repairs of vehicles. Among other information, the date of repair, properties of the vehic

Example for articulate reasons and construct arguments, A Class 4 teacher w...

A Class 4 teacher was going to teach her class fractions. At the beginning of the term she asked the children, "If you had three chocolates, and wanted to divide them equally among

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