lecture 2 differential equations ing. jaroslav jíra, csc. physics for informatics
TRANSCRIPT
Lecture 2Differential equations
Ing. Jaroslav Jíra, CSc.
Physics for informatics
Basic division of differential equations
According to type of derivation
Ordinary Differential Equations – ODEThey contain a function of one independent variable and its derivatives.
Example:
Partial Differential Equations - PDE They contain unknown multivariable functions and their partial derivatives.
Example:
xyyyorxydx
dy
dx
yd 22
2
2
),,,(
12
2
22
2
2
2
2
2
tzyxuwhere
dt
u
cdz
u
dy
u
dx
u
Types of Ordinary Differential Equations
First order differential equationsThe highest derivative of the function y of independent variable they contain is one.
Example:
Higher order differential equations They contain at least second derivative of the function y
Example:
xyy 2
xyyy 23
General definition of an ODE
0),....,,,(),....,,,( )()()1( nnn yyyyxForyyyyyxF
Types of Ordinary Differential Equations
Linear differential equationsThe function y appears just linearly here. There are no powers of the function y and its derivatives, there are no products of the funciton y and its derivatives. There are also no functions of the function y like sin(y), exp(y) etc.
Example:
Nonlinear differential equations If any of conditions previously defined for the linear DE is not met, then we talk about nonlinear DE.
Example:
xyyyy 23
000)sin( 2 yyoryyyoryy
Types of Ordinary Differential Equations
Homogeneous differential equationsThere is no constant or function of x on the right side of the equation.
Example:
Inhomogenous differential equations Exact opposite to the homogenous DE.
Example:
02 yyy
xyyoryy 3242
Types of Ordinary Differential Equations
Differential equations with constant coefficientsThe function y and all its derivatives are mutiplied just by constants.
Example:
Differential equations with variable coefficients The function y and its derivatives are mutiplied either by constants or by functions of x.
Example:
xyyyy 345
xyyeyx x 2)1(3
How to solve differential equations
The following methods will be mentioned subsequently
Separation of variables – applicable to homogeneous first order ODEs and to specific types of inhomogeneous first order ODEs.
Characteristic equation – applicable to homogeneous first order and higher order linear ODEs with constant coefficients
Integrating factor – applicable to inhomogeneous first order and higher order linear ODEs. This method usually completes the solution of previous two methods for inhomogeneous equations.
The most simple differential equation: )(' xfy
Integrating the last equation Cdxxfy )(
Example: xy 2'
dx
dyy 'where
CxCdxxy 22
Where x2+C is general solution of the differential equation
dxxfdy )(
Sometimes an additional condition is given like
3)2( y
that means the function y(x) must pass through a point ]3,2[0 x
123 2 CC
We have obtained a particular solution y(x)=x2 -1
1)( 2 xxy
First order inhomogenous linear differential equation with constant coefficients – separation of variables
?)( xy
)(xfdx
dy
First order homogenous linear differential equation with constant coefficients – separation of variables
0' byayThe general formula for such equation is ?)( xy
Now we integrate both sides of the equation and then we apply an exponential function to it
Cxa
by ln
substituting xa
b
Cey
Where C is a constant resulting from the initial condition
0bydx
dya y
a
b
dx
dy dx
a
b
y
dy
)(ln Cxa
by ee
xa
bC eey
CeC we obtain general solution
First order homogenous linear differential equation with constant coefficients – characteristic equation
0' byayThe general formula for such equation is
xx Ceyorey
?)( xy
To solve this equation we assume the solution in the form of exponential function.
xey xey 'If then
and the equation changes into
0baafter dividing by the eλx we obtaina
b
0 xx ebea 0)( bae x
the solution isx
a
b
Cey
Where C is a constant resulting from the initial condition
This is the characteristic equation
Example of the first order linear ODE – RC circuit
CR uuu
Find the time dependence of the electric current i(t) in the given circuit.
1.u Ri idt
C
Now we take the first derivative of the last equation with respect to time
011
0 iRCdt
dii
Cdt
diR
characteristic equation is
RCRC
10
1
general solution is
tRCKei1
Constant K can be calculated from initial conditions. We know that
R
uKKe
R
u
R
ui RC
0
)0(
tRCe
R
ui
1
particular solution is
Solution of the RC circuit in the Mathematica
Given values are R=1 kΩ; C=100 μF; u=10 V
First order inhomogenous linear differential equation with constant coefficients – integrating factor
QPyy 'The general formula for such equation is
Where P(x) and Q(x) are continuous functions of variable x.
PdxCeyCPdxy lnln
Having solution of homogeneous part of the equation we can continue by looking for the integrating factor. Instead of constant C we are looking for a function C(x), which satisfies both homogeneous solution and the original differential equation.
In the first step we omit the right side taking Q(x)=0 and than we can solve the homogeneous equation by separation of variables.
Separation of variables gives us: Pdxy
dyPy
dx
dy 0
)( dxQeKey dxPPdx
If C(x) should be a function, then
Substituting for y and y’ into the original equation QPyy
The general solution of this inhomogeneous equation is:
we obtain
and after small adjustment:
PdxexCy )(
PdxPdx PexCexCy )()(
QexPCPexCexC PdxPdxPdx )()()(
QexC Pdx )(
Our integrating factor is: KdxeQxC Pdx )(
Example of the integrating factor solution – LR circuit
LR uuU
Find the time dependence of the electric current i(t) in the given circuit.
Firstly we have to solve homogeneous equation
00 RLRidt
diL
Solution of charact. equation
In the second step we are looking for the integrating factor
tL
R
etKisotK
)()( 11
First derivative of the current
dt
diLRiU
tL
R
eKtiL
R 1)(
tL
Rt
L
R
etL
RtKetK
dt
di )()()( 11
General solution
Knowing that initial current is zero i(0)=0, we can determine K2.
Particular solution of the equation
Substituting for i and di/dt into the original equation gives us
UetRKetL
RtKetKL
tL
Rt
L
Rt
L
R
)())()()(( 111
2111 )()()( KeR
UtKe
L
UtKUetLK
tL
Rt
L
Rt
L
R
tL
Rt
L
R
eKeR
Ui
)( 2
tL
R
eKR
Ui
2
R
UKeK
R
U 2
020
)1(t
L
R
eR
Ui
Solution of the RC circuit in the Mathematica
Given values are R=1 kΩ; L=100 mH; U=10 V
Second order homogenous linear differential equation with constant coefficients
0''' cybyayThe general formula for such equation is
xey To solve this equation we assume the solution in the form of exponential function:
xey xey 'If then
and the equation will change into
02 cba after dividing by the eλx we obtain
02 xxx ecebea
0)( 2 cbae x
We obtained a quadratic characteristic equation. The roots are
xey 2'' and
a
acbb
2
42
12
?)( xy
There exist three types of solutions according to the discriminant D acbD 42
1) If D>0, the roots λ1, λ2 are real and distinct
xx eCeCy 2121
2) If D=0, the roots are real and identical λ12 =λ
xx xeCeCy 21
3) If D<0, the roots are complex conjugate λ1, λ2 where α and ω are real and imaginary parts of the root
i
i
2
1
xixxixxx eKeKeKeKy 212121
)( 21xixix eKeKey
]sin)(cos)[( 2121 xKKixKKey x
formulaEulers
xixe xi sincos
)();( 212211 KKiCKKC
]sincos[)( 21 xCxCexy x
If we substitute
we obtain
Further substitution is sometimes used cos;sin 21 ACAC
]sincoscossin[)( xAxAexy x and then
sincoscossin)sin( considering formula
we finally obtain )sin()( xAexy x
where amplitude A and phase φ are constants which can be obtained from initial conditions and ω is angular frequency.This example leads to an oscillatory motion.
This is general solution in some cases, but …
Example of the second order LDE – a simple harmonic oscillator
Evaluate the displacement x(t) of a body of mass m on a horizontal spring with spring constant k. There are no passive resistances.
xkF If the body is displaced from its equilibrium position (x=0), it experiences a restoring force F, proportional to the displacement x:
From the second Newtons law of motion we know
xmdt
xdmmaF
2
2
0 xm
kxkxxm Characteristic
equation is02
m
k
We have two complex conjugate roots with no real part m
ki12
)sin()( tAetx tThe general solution for our symbols is
No real part of λ means α=0, and omega in our casem
k
)sin()( tAtxThe final general solution of this example is
Answer: the body performs simple harmonic motion with amplitude A and phase φ. We need two initial conditions for determination of these constants.
These conditions can be for example
)cos(2)( ttx
20cos0)0cos(
A
The particular solution is
2)0(0)0( xx
From the first condition
From the second condition
22)2
0sin( AA
)2
sin(2)( ttx
Example 2 of the second order LDE – a damped harmonic oscillator
The basic theory is the same like in case of the simple harmonic oscillator, but this time we take into account also damping.
The damping is represented by the frictional force Ff, which is proportional to the velocity v.
xcdt
dxcvcFf
The total force acting on the body is xckxFkxF f
xmmaF 0 kxxcxmxckxxm
0 xm
kx
m
cx The following substitutions
are commonly used m
c
m
k 2;
02 2 xxx Characteristic equation is 02 22
2222
12 2
442
Solution of the characteristic equation
where δ is damping constant and ω is angular frequency
There are three basic solutions according to the δ and ω.
1) δ>ω. Overdamped oscillator. The roots are real and distinct
222
221
tt eCeCtx 2121)(
2) δ=ω. Critical damping. The roots are real and identical.
12
tt teCeCtx 21)(
3) δ<ω. Underdamped oscillator. The roots are complex conjugate.
'
'
222
221
ii
ii
)'sin()( tAetx t
Damped harmonic oscillator in the Mathematica
Damping constant δ=1 [s-1], angular frequency ω=10 [s-1]
Damped harmonic oscillator in the Mathematica
All three basic solutions together for ω=10 s-1 Overdamped oscillator, δ=20 s-1
Critically damped oscillator, δ=10 s-1
Underdamped oscillator, δ=1 s-1