Cheatsheet First Ode

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CME 102 – Ordinary Differential Equations for Engineers https://stanford.

edu/~shervine

VIP Cheatsheet: First-order ODE Separation of variables


r Separable – An ODE is said to be separable if it can be written in the form:

f (x,y) = g(x)h(y)
Afshine Amidi and Shervine Amidi
r Reduction to separable form – The following table sums up the variable changes that
September 8, 2020 allow us to change the ODE y 0 = f (x,y) to u0 = g(x,u) that is separable.

Original form Change of variables New form


y
 y
y0 =f x
u, x
u0 x + u = f (u)
Introduction
0
u −a
r Differential Equations – A differential equation is an equation containing derivatives of a y 0 = f (ax + by + c) u , ax + by + c b
= f (u)
dependent variable y with respect to independent variables x. In particular,

• Ordinary Differential Equations (ODE) are differential equations having one independent Equilibrium
variable.
r Characterization – In order for an ODE to have equilibrium solutions, it must be (1)
• Partial Differential Equations (PDE) are differential equations having two or more inde- autonomous and (2) have a value y ∗ that makes the derivative equal to 0, i.e:
pendent variables.
dy dy ∗
(1) = f (t,y)
C = f (y) and (2) ∃ y∗ , = f (y ∗ ) = 0
dt dt
r Order - An ODE is said to be of order n if the highest derivative of the unknown function in
the equation is the nth derivative with respect to the independent variable.
r Stability – Equilibrium solutions can be classified into 3 categories:
r Linearity – An ODE is said to be linear only if the function y and all of its derivatives appear
by themselves. Thus, it is of the form: • Unstable: solutions run away with any small change to the initial conditions.
• Stable: any small perturbation leads the solutions back to that solution.
an (x)y (n) + an−1 (x)y (n−1) + ... + a1 (x)y 0 + a0 (x)y + b(x) = 0 • Semi-stable: a small perturbation is stable on one side and unstable on the other.

Direction Field Method Linear first-order ODE technique


r Implicit form – The implicit form of an ODE is where y0 is not separated from the remaining r Standard form – The standard form of a first-order linear ODE is expressed with p(x), r(x)
terms of the ODE. It is of the form: known functions of x, such that:
y 0 + p(x)y = r(x)
F (x,y,y 0 ) = 0
Remark: If r = 0, then the ODE is homogenous, and if r 6= 0, then the ODE is inhomogeneous.

Remark: Sometimes, y0cannot be separated from the other terms and the implicit form is the r General solution – The general solution y of the standard form can be decomposed into a
only one that we can write. homogenous part yh and a particular part yp and is expressed in terms of p(x), r(x) such that:
´ ´ ˆ  ´
r Explicit form – The explicit form of an ODE is where y 0 is separated from the remaining 
terms of the ODE. It is of the form: y = yh + yp with yh = Ce− pdx and yp = e− pdx × re pdx dx
y 0 = f (x,y) ´
Remarks: Here, for any function p, ´
the notation pdx denotes the primitive ´
of p without
additive constant. Also, the term e− pdx is called the basis of the ODE and e pdx is called the
r Direction field method – The direction field method is a graphical representation for the integrating factor.
solution of ODE y 0 = f (x,y) without actually solving for y(x). Here is the procedure:
r Reduction to linear form – The one-line table below sums up the change of variables that
• Determine the values (xi ,yi ) that form the grid. we apply in order to have a linear form:

• Compute the slope f (xi ,yi ) for each point of the grid. Name, setting Original form Change New form

• Report the associated vector for each point of the grid. Bernoulli, n ∈ R\{0,1} y0 + p(x)y = q(x)y n u, y 1−n u0 + (1 − n)p(x)u = (1 − n)q(x)

Stanford University 1 Spring 2018


CME 102 – Ordinary Differential Equations for Engineers https://stanford.edu/~shervine

Existence and uniqueness of an ODE Type Update formula Error Stability condition
2
Here, we are given an ODE y 0 = f (x,y) with initial conditions y(x0 ) = y0 . Forward Euler yn+1 = yn + hf (tn ,yn ) O(h) h< |λ|

r Existence theorem – If f (x,y) is continuous at all points in a rectangular region containing Backward Euler yn+1 = yn + hf (tn+1 ,yn+1 ) O(h) None
(x0 ,y0 ), then y 0 = f (x,y) has at least one solution y(x) passing through (x0 ,y0 ).
Remark: If the condition does not apply, then we cannot say anything about existence.
r Runge-Kutta methods – The table below sums up the most commonly used Runge-Kutta
r Uniqueness theorem – If both f (x,y) and ∂f (x,y) are continuous at all points in a rect- methods:
∂y
angular region containing (x0 ,y0 ), then y 0 = f (x,y) has a unique solution y(x) passing through
(x0 ,y0 ). Type Method Update formula Error Stability condition
Remark: If the condition does not apply, then we cannot say anything about uniqueness. 2
RK1 Euler’s yn+1 = yn + hk1 O(h) h<
|λ|
where k1 = f (tn ,yn )
Numerical methods for ODE - Initial value problems 
1
yn+1 = yn + h k
2 1
+ 12 k2
In this section, we would like to find y(t) for the interval [0,tf ] that we divide into N + 1 2
equally-spaced points t0 < t1 < ... < tN = tf , such that: RK2 Heun’s where k1 = f (tn ,yn ) O(h2 ) h<
|λ|
and k2 = f (tn + h,yn + hk1 )
dy
= f (t,y) with y(0) = y0
dt
System of linear ODEs
r Error – In order to assess the accuracy of a numerical method, we define its local and global r Definition – A system of n first order linear ODEs
errors local , global as follows: (y0 = a y + ... + a y
1 11 1 1n n
v ..
u N .
yn0 = a y + ... + a
nn yn
u1 X n1 1
local = |y exact (tn ) − y numerical (tn )| and global = t |y exact (tn ) − y numerical (tn )|2
N can be written in matrix form as:
n=1
y 0 = A~
~ y
Remarks: If local = O(hk ),
then global = O(hk−1 ). Also, when we talk about the ’error’ of a  a11 ··· a1n   y1 
method, we refer to its global error. .. .. .. ..
where A = . and ~
y=
. . .
r Taylor series – The Taylor series giving the exact expression of yn+1 in terms of yn and its an1 ··· ann yn
derivatives is:
+∞ r System of homogeneous ODEs – The resolution of the system of 2 homogeneous linear
0 h2 00 h3 000 X hk (k) y 0 = A~
ODEs ~ y is detailed in the following table:
yn+1 = yn + hyn + yn + yn + ... = yn
2 6 k!
k=0
Case Eigenvalues ↔ Eigenvectors Solution
We can also have an expression of yn in terms of yn+1 and its derivatives:
Real distinct λ1 ↔ η
~λ1 ~ ~λ1 eλ1 t + C2 η
y = C1 η ~λ2 eλ2 t
+∞
eigenvalues λ2 ↔ η
~λ2
h2 00 h3 000 X (−h)k (k)
0
yn = yn+1 − hyn+1 + yn+1 − yn+1 + ... = yn+1 Double root λ↔η ~ ~
y = [(C1 + C2 t)~ ~]eλt
η + C2 ρ
2 6 k!
k=0 eigenvalues ~ s.t. (A − λI)~
ρ ρ=η
~
Complex conjugate α + iβ ↔ η
~R + i~
ηI ~
y = C1 (cos(βt)~ ηI )eαt
ηR − sin(βt)~
r Stability – The stability analysis of any ODE solver algorithm is performed on the model eigenvalues α − iβ ↔ η
~R − i~
ηI ηR )eαt
ηI + sin(βt)~
+C2 (cos(βt)~
problem, defined by:
y 0 = λy with y(0) = y0 and λ<0

which gives yn = y0 σn , for which h verifies the condition |σ(h)| < 1.


r Euler methods – The Euler methods are numerical methods that aim at estimating the
solution of an ODE:

Stanford University 2 Spring 2018

You might also like