Sunteți pe pagina 1din 17

Differential equations

ODE toolbox in Matlab

Overview Definition Types of problems encountered Dealing with higher order equations Types of numerical methods Key techniques for ODEs

Definition
A differential equation is an equation that defines a relationship between a function and one or more derivatives of that function. Let y be some function of the independent variable t. Then following are some differential equations relating y to one or more of its derivatives.

Types-DE
Ordinary and Partial DE Linear and Nonlinear Differential Equation Delay differential equation Homogenous and non homogenous equation Exact Separable Integrating factor Euler and Cauchy type Legendre Bernoulli Clairaut

PDE Differential Equation is differential A Partial


equation in which the dependent varialble depends on two or more independent variables Like ordinary differential equations, partial differential equations are equations to be solved in which the unknown element is a function, but in PDEs the function is one of several variables, and so of course the known information relates the function and its partial derivatives with respect to the several variables. Roughly corresponding to the initial values in an ODE problem, PDEs are usually solved in the presence of boundary conditions.

Types- PDE
Hyperbolic(The Wave Equation ) Elliptical(Laplace) Parabolic(Heat equation)

Order
Order: The order of a differential equation is the order of the highest derivative that appears in the equation. First-Order : dy/dx = 3x2+10x+3 , y = 3x3+4x+2 Second-Order: d2y/dx2 = 4x + 5, y = 5x4+3 Third-Order: y = 6x +2 Forth-Order: y(4) = 4x2 + 4x + 7

General Solution
General Solution: A general solution of a differential equation represents an infinite number of solutions, where the arbitrary constant C may be any real or complex number. For example, the general solution of y = 2x yields y = x2 + C.

Particular Solution:
Particular Solution: A particular solution is created when the constant C has a specific value, which occurs when initial conditions are given and the correspondence of a particular value of the independent variable x gives a specific value y. For example, the particular solution of y = 2x with the initial condition of y(0) = 2, yields y = x2 + 2.

Types of Problems Ordinary differential equations (ODEs) Differential-algebraic equations (DAEs) Algebraic equations (AEs)

Example Problems
Ordinary differential equations (ODEs) Differential - algebraic equations (DAEs)

Differential equation types


Linear and non linear differential equation Stiff and non stiff differential equation

Categories of Methods

ODE Solver Categories

Based on step arrangement

Based on equation form

Single step

Multi-step

Explicit

Implicit

Key Numerical Methods Euler s method


MATLAB code easy to write Terrible for stiff problems Low accuracy

Runge-Kutta methods
MATLAB codes ODE23, ODE45 Good for non-stiff problems High accuracy

Suppose you have a differential equation like (dy/dx) = x-y (or any other function), with y(0)=1 then the Runge-Kutta method would be: (N.B. : everything between [ ] is subscript.) x[n+1] = x[n]+h p[n] = f( x[n], y[n]) q[n] = f( x[n]+(h/2), y[n]+(h/2)*p[n]) r[n] = f( x[n]+(h/2), y[n] +(h/2)*q[n]) s[n] = f( x[n]+h, y[n]+h* r[n]) y[n+1] = y[n] + (h/6)(p[n]+2*q[n]+2*r[n]+s[n] Where h is some iteration step. (f.e. 0.1). do all the iterations in the interval you want to know. For instance, if you want to approximate values on [0,1], you would start with x[0]=0 en with the iteration step 0.1 you would have 10 iterations to end in x[1].

PDE

The elliptic and

S-ar putea să vă placă și