Gilbert Strang and Cleve Moler provide an overview to their in-depth video series about differential equations and the MATLAB ODE suite.
The classic Lotka-Volterra model of predator-prey competition is a nonlinear system of two equations, where one species grows exponentially and the other decays exponentially in the absence of the other. The program "predprey" studies this model.
The Lorenz chaotic attractor was discovered by Edward Lorenz in 1963 when he was investigating a simplified model of atmospheric convection. It is a nonlinear system of three differential equations. The program "lorenzgui" studies this model.
Throw a rectangular box with sides of three different lengths into the air. You can get the box to tumble stably about its longest axis or its shortest axis. But if you try to make it tumble about it middle axis, you will find the motion is unstable.
An ODE involving higher order derivatives is rewritten as a vector system involving only first order derivatives. The classic Van der Pol nonlinear oscillator is provided as an example. The VdP equation becomes stiff as the parameter is increased.
The MATLAB documentation provides two charts summarizing the features of each of the seven functions in the MATLAB ODE suite.
ODE45 is usually the function of choice among the ODE solvers. It compares 4th and 5th order methods to estimate error and determine step size.
A problem is said to be stiff if the solution being sought varies slowly, but there are nearby solutions that vary rapidly, so the numerical method must take small steps to obtain satisfactory results. The flame model demonstrates stiffness.
The digits in the name of a MATLAB ODE solver reflect its order and resulting accuracy. A method is said to have order p if cutting the step size in half reduces the error in one step by a factor of two to the power p+1.
ODE23 compares 2nd and 3rd order methods to automatically choose the step size and maintain accuracy. It is the simplest MATLAB solver that has automatic error estimate and continuous interpolant. ODE23 is suitable for coarse accuracy requirements.
ODE2 implements a midpoint method with two function evaluations per step. This method is twice as accurate as Euler's method. A nonlinear equation defining the sine function provides an example. An exercise involves implementing a trapezoid method.
ODE4 implements the classic Runge-Kutta method, the most widely used numerical method for ODEs over the past 100 years. Its major shortcoming is the lack of an error estimate. A simple model of the growth of a flame is an example that is used.
ODE1 implements Euler's method. It provides an introduction to numerical methods for ODEs and to the MATLAB suite of ODE solvers. Exponential growth and compound interest are used as examples.
Laplace's partial differential equation describes temperature distribution inside a circle or a square or any plane region.
A Fourier series separates a periodic function into a combination (infinite) of all cosine and since basis functions.
Even functions use only cosines and odd functions use only sines. The coefficients in the Fourier series come from integrals.
Around every circle, the solution to Laplace’s equation is a Fourier series with coefficients proportional to r^n. On the boundary circle, the given boundary values determine those coefficients.
The heat equation starts from a temperature distribution at t = 0 and follows it as it quickly becomes smooth.
The wave equation shows how waves move along the x axis, starting from a given wave shape and its velocity. There can be fixed endpoints as with a violin string.
A second order equation can change from two initial conditions to boundary conditions at two points.
The SVD factors each matrix into an orthogonal matrix times a diagonal matrix (the singular value) times another orthogonal matrix: rotation times stretch times rotation.
Symmetric matrices have n perpendicular eigenvectors and n real eigenvalues.
An oscillation equation has 2n solutions, n cosines and n sines. Those solutions use the eigenvectors and eigenvalues.
A positive definite matrix has positive eigenvalues, positive pivots, positive determinants, and positive energy.
The shortest form of the solution uses the matrix exponential multiplying the starting vector (the initial condition).
If A and B are "similar" then B has the same eigenvalues as A.
The eigenvectors remain in the same direction when multiplied by the matrix. Subtracting an eigenvalue from the diagonal leaves a singular matrix: determinant zero. An n by n matrix has n eigenvalues.
A matrix can be diagonalized if it has n independent eigenvectors. The diagonal matrix Λ is the eigenvalue matrix.
Diagonalizing a matrix also diagonalizes all its powers.
An eigenvalue / eigenvector pair leads to a solution to a constant coefficient system of differential equations. Combinations of those solutions lead to all solutions.
The incidence matrix has a row for every edge, containing -1 and +1 to show which two nodes are connected by that edge.
Capturing all combinations of the columns gives the column space of the matrix. It is a subspace (such as a plane).
Vectors are a basis for a subspace if their combinations span the whole subspace and are independent: no basis vector is a combination of the others. Dimension = number of basis vectors.
A matrix produces four subspaces: column space, row space (same dimension), the space of vectors perpendicular to all rows (the nullspace), and the space of vectors perpendicular to all columns.
A graph has nodes connected by edges (other edges can be missing). This is a useful model for the Internet, the brain, pipeline systems, and much more.
A critical point is a constant solution to the differential equation. The slope of the right hand side decides stability or instability.
With two equations, the two linearized equations use the 2 by 2 matrix of partial derivatives of the right hand sides.
Two equations with a constant matrix are stable (solutions approach zero) when the trace is negative and the determinant is positive.
A box in the air can rotate stably around its shortest and longest axes. Around the middle axis it tumbles wildly.
The direction field has an arrow with slope at each point coming from the differential equation. Arrows with the same slope lie along an "isocline".
Solutions to second order equations can approach infinity or zero. Saddle points have a positive and also a negative exponent or eigenvalue.
With constant coefficients in a differential equation, the basic solutions are exponentials. The exponent solves a simple equation.
The impulse response is the solution when the force is an impulse (a delta function). This also solves a null equation (no force) with a nonzero initial condition.
Imaginary exponents with pure oscillation provide a "center" in the phase plane. The point (position, velocity) travels forever around an ellipse.
A second order equation gives two first order equations. The matrix becomes a companion matrix (triangular).
Combine null solutions to find a particular solution for any right hand side. But it may involve a difficult integral.
Transform each term in the linear differential equation to create an algebra problem. You can transform the algebra solution back to the ODE solution.
When the input force is an impulse, the output is the impulse response. For all inputs the response is a "convolution" with the impulse response.
Current flowing around an RLC loop solves a linear equation with coefficients L (inductance), R (resistance), and 1/C (C = capacitance).
With constant coefficients and special forcing terms (powers of t, cosines/sines, exponentials), a particular solution has this same form.
This method is also successful for forces and solutions equal to polynomials times exponentials. Substitute into the equation!
The algebra problem involves the transfer function. The poles of that function are all-important.