What types of integration can MATLAB perform?
Date Last Modified: Wednesday, September 8, 2010
| Solution ID: | 1-1679J | |
| Product: | MATLAB | |
| Reported in Release: | R14 | |
| Platform: | All Platforms | |
| Operating System: | All OS |
Subject:
What types of integration can MATLAB perform?
Problem Description:
I would like to know if I can solve ordinary differential equations in MATLAB.
I also would like to know if there are methods included in the ODE Suite for Green's Theorem, Stoke's Theorem, and/or the Gauss Divergence Theorem.
I would also like to know about symbolic and numerical integration, boundary value problems, and differential algebraic equations or equations written in semi-explicit form.
Solution:You can do the following types of integration with MATLAB using our pre-written integration routines:
If you have a line integral: if x = f(t), y = g(t), z = h(t), for a curve w
then the function to integrate is:
on the interval [ta tb]. Note that F does not depend on Y. However, Surface Integrals, Triple Integration, Green's Theorem, Stoke's Theorem, and the Gauss Divergence Theorem all involve integration across multiple dimensions. Therefore the ODE Suite does not support these integration techniques. One reason that these techniques cannot be expressed in the format: dy/dt=F(t,y), is that they all involve d/dx's and d/dy's. Ordinary differential equations involve derivatives with respect to only one variable. For more information on using the ODE Suite, please type the following comand on the MATLAB command prompt:
You can also access it using the following link: http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-662913.html Using the DOC command (ex, 'doc ode45') will allow you to get several examples as well as additional documentation. B. For solving a differential equation symbolically: The DSOLVE function can be used for this. This function is included in the Symbolic Toolbox (the Maple kernal included with the Symbolic Toolbox performs the calculations and returns a solution to MATLAB). C. For solving differential algebraic equations (DAEs): Equations written as f(x',x,t) = 0 are differential algebraic equations (DAE). There are no methods known to solve these problems in general; only some special cases can be solved (i.e. index less than 2). You may want to look at "Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations" by K.E. Brenan, S.L. Campbell, L.R. Petzold for more information on this. The ODE15S, which was added in MATLAB 5.3, can be used to solve differential algebraic equations of index 1. The attached paper describes this in more detail. D. For solving boundary value problems (BVPs): A Boundary Value Problem is similiar to an Initial Value Problem in dealing with Ordinary Differential Equations. The difference is that instead of knowing n initial conditions, you might know n conditions at various points in time. For example, with a second order Initial Value Problem, you need to know the initial position and initial velocity, but with a Boundary Value Problem, you might know initial position and final position, or initial velocity and final position, etc. Since all Boundary Value Problems are different, we do not have any routines that solve a general example. It may be possible to solve a Boundary Value Problem by writing your own function, using a combination of ODE solvers and optimization tools like FMINS, or the functions in the Optimization Toolbox, but we don't have any examples on how to do this. You may want to look at references for the "shooting method," a technique used for solving these types of problems. As of MATLAB 6.0 ( R12) we have the BVP4C for solving Boundary Value Problems. For more information about using BVP4C, including information on how to solve BVPs with periodic boundary conditions, see the attached paper, bvp_paper.pdf. E. For numerically computing integrals whose integrand is defined by a function: The QUAD and DBLQUAD functions use a low order adaptive recursive Simpson's rule, while QUAD8 uses a higher order method adaptive recursive Newton-Cotes 8 panel rule. Neither method is designed to integrate singularities (integrable or non-integrable). Examples of usage and more details can be found with the DOC command and by typing the following command on the MATLAB command prompt:
Also you can access it at the following location: http://www.mathworks.com/access/helpdesk/help/techdoc/math/bsgprfe-1.html F. For numerically computing integrals whose integrand is defined by numerical data: The TRAPZ and CUMTRAPZ functions perform a trapezoidal integration over a given data set. G. For solving symbolic integrals (definite and indefinite) using the Symbolic Toolbox: The INT command can be used for this (the symbolic integration is performed using the Maple kernel included with the Symbolic Toolbox). H. For solving delay differential equations The DDE23 command solves a differential equation where the derivative of the function y at a certain time depends on the value of the function y at earlier times. For example, the following equation is a delay differential equation:
Here are some examples of how these functions can be used:
|
Related Documents/Files:
Related Solutions:
|
|
