1/33
Notes about ordinary differential equations. Master BME, Math Level - - PowerPoint PPT Presentation
Notes about ordinary differential equations. Master BME, Math Level - - PowerPoint PPT Presentation
Notes about ordinary differential equations. Master BME, Math Level 2 October 10, 2019 1/33 Differential equations and systems of differential equations Basic notions and examples Ordinary Differential Equation (ODE) : equation involving an
2/33 Differential equations and systems of differential equations
Basic notions and examples
◮ Ordinary Differential Equation (ODE) : equation involving an
unknown function x(t), its derivative x′(t), and possibly its higher-order derivatives x′′(t), x(3)(t), etc. up to a given order x(n)(t), that is supposed to be satisfied for each t.
◮ examples:
◮ x′(t) + x(t) = 0 is an ODE of order 1, ◮ x′(t) = tx(t) + t2 is an ODE of order 1, ◮ x′′(t) = cos(x′(t))x(t) is an ODE of order 2.
◮ ODE are called ”ordinary” to distinguish them from Partial
Differential Equations (PDE) which involve partial derivatives of functions of several variables.
3/33 Differential equations and systems of differential equations
Basic notions and examples
◮ About notations :
◮ derivatives are sometimes written dx
dt (t), d2x dt2 (t) (the standard
notation), ˙ x(t), ¨ x(t), instead of x′(t), x′′(t).
◮ here we use the notation x(t), meaning that x is the unknown function
and t is the variable, but many other notations can be found in books : f (t), f (x), y(t), y(x)...
◮ sometimes we drop out the ”(t)” in the equation to simplify the
- notation. For example the 3 previous ODEs could be written also
x′ + x = 0, x′ = tx + t2, x′′ = cos(x′)x.
4/33 Differential equations and systems of differential equations
Two easy things with ODEs
1) Knowing an ODE and a candidate solution, it is easy to check that it is actually a solution. Examples:
◮ x(t) = e−t is solution of x′ + x = 0, because indeed
x′(t) = −e−t = −x(t), so x′(t) + x(t) = 0.
◮ x(t) = cos(t) is solution of x′′ + x = 0, because x′(t) = − sin(t) and
x′′(t) = − cos(t) = −x(t).
5/33 Differential equations and systems of differential equations
Two easy things with ODEs
2) From a function x(t), it is easy to find an ODE which it satisfies. Examples:
◮ if x(t) = t2 + 2, then x′(t) = 2t, so 1 2tx′(t) − x(t) + 2 = 0. Hence 1 2tx′ − x + 2 = 0 is an ODE which admits x(t) = t2 + 2 as solution. ◮ if x(t) = sin(t), then x′(t) = cos(t), so we have
sin(t)x′(t) − cos(t)x(t) = 0. Hence sin(t)x′ − cos(t)x = 0 is an ODE which admits x(t) = sin(t) as solution. But in this case we can also notice that x′′(t) = − sin(t) so we have that x′′(t) + x(t) = 0. Hence, x′′ + x = 0 is another ODE which admits x(t) = sin(t) as solution.
6/33 Differential equations and systems of differential equations
Terminlogy of ODEs
◮ Autonomous ODE : An ODE is autonomous when the variable t
does not appear in the equation, except through the function x(t) and its derivatives. For example x′′(t)2x′(t) + x(t) = 0 is an autonomous ODE, while x′′(t) = t + cos(x(t)) is not autonomous. Remark: if x(t) is the solution of an autonomous ODE, then any x(t + λ) where λ is a constant number, is also a solution. For example, x(t) = cos(t), x(t) = cos(t + 2) or x(t) = cos(t + π/2) = − sin(t) are all solutions of the ODE x′′ + x = 0. Graphically, this means that by translating the graph of a solution along the horizontal axis, we get the grpahs of other solutions of the equations.
7/33 Differential equations and systems of differential equations
Terminlogy of ODEs
◮ Explicit ODE : An ODE is explicit if it is of the form x(n)(t) = ...,
where ... contains terms involving derivatives of x(t) of order lower than n. For example x′ = ex + t2, x′′ = x′ + x2 − sin(t) are explicit ODEs, while x′′2 cos(x) = x′ is not (so it is implicit). Remark: Most of the times an implicit ODE can be put in explicit form, but this may involve making some assumptions about the
- solution. For example x′′2 cos(x) = x′ is equivalent to the explicit
form x′′ =
- x′/ cos(x), but only when cos(x(t)) = 0 and
x′(t)/ cos(x(t)) ≥ 0.
8/33 Differential equations and systems of differential equations
Linear equations
◮ A linear ODE is an ODE of the form
a0(t)x(t) + a1(t)x′(t) + · · · + an(t)x(n)(t) = b(t), where the ai(t) and b(t) are known functions.
◮ A linear ODE is homogeneous if b(t) = 0. ◮ A linear ODE is with constant coefficients if the ai(t) are just
constants.
◮ examples:
◮ tx + etx′ = 2t is a linear ODE, ◮ x′′ − x′ + 4x = 5 cos(t) is a linear ODE with constant coefficients, ◮ x′ − tx = 0 is a homogeneous linear ODE.
9/33 Differential equations and systems of differential equations
Solutions of linear ODEs
◮ A classical way to solve a linear ODE is first to consider the
associated homogeneous ODE, obtained by replacing b(t) by 0. This is because of the following important result: the solutions of a linear ODE form an affine subspace, whose direction (i.e. its unique parallel linear subspace) is the space of solutions of the associated homogeneous equation.
◮ Consequently, one gets the general solutions of a linear ODE by
adding any particular solution of this ODE to the general solutions of the associated homogeneous ODE.
10/33 Differential equations and systems of differential equations
Solutions of first order linear ODEs with constant coefficients
It can be put in the form : x′ = ax + b(t).
◮ The associated homogeneous ODE is x′ = ax and has general
solution x(t) = λeat, λ ∈ R.
◮ To get a particular solution of the original ODE, it is possible to use
the method of variation of constant: we look at a solution of the form x(t) = λ(t)eat. Then writing the ODE, one gets after simplification that λ′(t)eat = b(t), so we are left to compute an integral of the function e−atb(t). Hence if F(t) is such an integral,
- ne gets the particular solution as F(t)eat, and thus the general
solution of the original ODE is x(t) = F(t)eat + λeat = (F(t) + λ)eat, λ ∈ R.
11/33 Differential equations and systems of differential equations
Domain of a solution and maximal domains
◮ When considering an ODE, one may look at solutions defined only on
a specific domain, i.e. a specific range of t values:
◮ either because the ODE itself assumes some constraints over t. For
example, the ODE x′ + x = √t − 1 is defined only when t ≥ 1, so we cannot look at solution in a domain which is larger than [0, +∞).
◮ or because for some other reason we want to restrict to a specific
domain, e.g. quite arbitrary we may wish to look at solutions only over the domain (1, 5) for the previous equation.
◮ A domain is maximal for a given solution of an ODE when we cannot
get the same solution over a larger domain of R. For example, x(t) = et is a solution of x′ = x in the domain (0, +∞) but this domain is not maximal because x(t) = et can be defined over all R, and it is still a solution of x′ = x over R. Hence R is the maximal domain for this solution. See exercise 1 for a less trivial example.
12/33 Differential equations and systems of differential equations
Initial Value Problems (IVP)
◮ Most of the times, an ODE has an infinite number of solutions (for
example x′ = x admits all functions x(t) = λet with λ ∈ R a solutions.
◮ But most of the times also, one gets a unique solution when fixing
the values and derivatives of x at a specific t0. The ODE, together with these constraints, form an initial value problem (IVP). Usually the number of constraints one has to fix must correspond to the order
- f the ODE.
◮ examples (to check as an exercise)
◮ The IVP
x′ = x x(1) = 1 has unique solution x(t) = et−1.
◮ The IVP
x′′ = 2x′ − x x(0) = 1 x′(0) = −1 has unique solution x(t) = (1 − 2t)et.
13/33 Differential equations and systems of differential equations
Numerical solutions of ODEs
◮ Euler scheme is the simplest and most well-known method to solve
an IVP numerically. Consider any first order ODE in explicit form, with an initial condition: x′ = f (t, x) x(t0) = x0 The Euler scheme simply approximates x′(t) by a difference quotient: x′(t) ≈ x(t + h) − x(t) h , which yields x(t + h) ≈ x(t) + hf (t, x). Thus, starting from position x0 at t0, and fixing a stepsize h > 0, one can compute approximations x1 ≈ x(t0 + h), x2 ≈ x(t0 + 2h), etc. iteratively using the rule xk+1 = xk + h f (t0 + kh, xk).
14/33 Differential equations and systems of differential equations
Numerical solutions of ODEs
◮ example : Consider the ODE (1 + x2)x′ = sin(t2). It can be put
directly in explicit form x′ = f (t, x) with f (t, x) = sin(t2)
1+x2 . Here is a
plot of 100 iterations of the Euler scheme for t0 = 0, x0 = 1, with stepsize h = 0.05:
◮ The Euler method is very simple, but not very accurate. One has to
decrease the stepsize h, hence to perform more iterations, in order to get precise results. Numerical solvers such as the function ode45 of Matlab usually implement more complex schemes called Runge-Kutta methods that allow to get accurate results with less iterations (see exercise 4).
15/33 Differential equations and systems of differential equations
Systems of ODEs
A system of ODEs is a system of several differential equations involving several unknown functions x(t), y(t), z(t), etc. The dimension of the sytem corresponds to the number of unknown functions. For example, x′′ + xy = z y′z = cos(tx), z′′ = exy (∗) is a system of ODEs of dimension 3, and order 2 (since derivatives up to
- rder 2 are involved).
16/33 Differential equations and systems of differential equations
Systems of ODEs
Any ODE, whatever its order, can be transformed to become a system of ODE of order 1. Examples:
◮ The ODE log(x′′) − x′2 + 3x = t is equivalent to the order 1 system
log(y′) − y2 + 3x = t y = x′ ,
◮ The previous system (∗) is equivalent to the order 1 system
u′ + xy = z y′z = cos(tx), v′ = exy u = x′ v = z′
17/33 Differential equations and systems of differential equations
First order system of ODE with constant coefficients
Any first order explicit linear system of ODEs with constant coefficients can be written in matrix form. For example, x′ = 3x − z + et, y′ = −3x − t, z′ = x + y + z ⇔ X ′ = AX + B(t) with X = x y z , A = 3 −1 −3 1 1 1 , and B(t) = et −t . Thus we are left to study first-order ODEs of the form X ′ = AX + B(t) where X is an unknown vector valued function of size n, B(t) a known vector-valued function of size n, and A a known n × n matrix with constant coefficients.
18/33 Differential equations and systems of differential equations
First order system of ODE with constant coefficients
◮ As previously, first we consider the associated homogeneous ODE :
X ′ = AX. We look at solutions of the form X = eαtU, where U is a constant vector. In this case we have that X ′ = αeαtU and AX = eαtAU, and thus it implies that AU = αU, which means that α is an eigenvalue of A with associated eigenvector U. Conversely, it is easy to check that if AU = αU, X = eαtU is a solution of the ODE.
◮ Hence we have found that any X = eαtU, where α is an
eigenvalue of A and U is its associated eigenvector is a solution
- f the ODE X ′ = AX.
19/33 Differential equations and systems of differential equations
First order system of ODE with constant coefficients
◮ When A is a diagonalizable matrix, this implies that we have found
all solutions, because it is a known result that the space of solutions is n-dimensional. Hence, in this case, the general solution of X ′ = AX is X = λ1eα1tU1 + · · · + λneαntUn where the Ui form a basis of eigenvectors of the matrix A, and αi are the associated eigenvalues (possibly complex valued).
◮ When A is not diagonalizable, we get further solutions for
eigenvalues α having multiplicities using functions of the form teαt, t2eαt, etc. (see later).
20/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has two distinct real eigenvalues α1 > α2 > 0: unstable node
◮ example : A =
5 −2 −1 4
- ⇒
Sp(A) = {6, 3} phase portrait in phase portrait in eigenvector coordinates
- riginal coordinates
21/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has two distinct real eigenvalues α1 < α2 < 0: stable node
◮ example : A =
−5 2 1 −4
- ⇒
Sp(A) = {−6, −3} phase portrait in phase portrait in eigenvector coordinates
- riginal coordinates
22/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has two distinct real eigenvalues α1 < 0 < α2: saddle (unstable)
◮ example : A =
3 −6 −3
- ⇒
Sp(A) = {−3, 6} phase portrait in phase portrait in eigenvector coordinates
- riginal coordinates
23/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
special case : A is a scalar matrix with diagonal values α1 = α2 > 0: unstable node
◮ example : A =
6 6
- ⇒
Sp(A) = {6, 6} phase portrait in
- riginal coordinates
24/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
special case : A is a scalar matrix with diagonal values α1 = α2 < 0: stable node
◮ example : A =
−3 −3
- ⇒
Sp(A) = {−3, −3} phase portrait in
- riginal coordinates
25/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has two complex conjugate eigenvalues α1 = η + iµ, α2 = η − iµ with η > 0 : unstable focus
◮ example : A =
5 −8 5 1
- ⇒
Sp(A) = {3 − 6i, 3 + 6i} phase portrait in phase portrait in transformed coordinates
- riginal coordinates
26/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has two complex conjugate eigenvalues α1 = η + iµ, α2 = η − iµ with η < 0 : stable focus
◮ example : A =
−1 −8 5 −5
- ⇒
Sp(A) = {−3 − 6i, −3 + 6i} phase portrait in phase portrait in transformed coordinates
- riginal coordinates
27/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has two complex conjugate eigenvalues α1 = iµ, α2 = −iµ (so η = 0) : center
◮ example : A =
2 −8 5 −2
- ⇒
Sp(A) = {−6i, 6i} phase portrait in phase portrait in transformed coordinates
- riginal coordinates
28/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has one repeated real eigenvalue α > 0: improper unstable node
◮ example : A =
5 −2 2 1
- ⇒
Sp(A) = {3} phase portrait in phase portrait in eigenvector coordinates
- riginal coordinates
29/33 Differential equations and systems of differential equations
Phase portraits for 2D planar linear systems
If A has one repeated real eigenvalue α < 0: improper stable node
◮ example : A =
−1 −2 2 −5
- ⇒
Sp(A) = {−3} phase portrait in phase portrait in eigenvector coordinates
- riginal coordinates
30/33 Differential equations and systems of differential equations
Phase portraits for 2D planar nonlinear systems
x′
1 = x2 − x2 1
x′
2 = x1 − 2.
31/33 Differential equations and systems of differential equations
Phase portraits for 2D planar nonlinear systems
x′
1 = 3x2 1 − 12x1
x′
2 = 3x2 2 + 12x2.
32/33 Differential equations and systems of differential equations
Phase portraits for 2D planar nonlinear systems
The classical pendulum: x′′ = −sin(x) ⇔ x′
1 = x2
x′
2 = −sin(x1).
33/33 Differential equations and systems of differential equations