Professional Documents
Culture Documents
Chapter #1
Introduction
1st order dynamics
2nd order dynamics
Nonhomogeneous differential equations
Introduction
dx d 2x
ΣF = ma ⇔ f − f friction = ma ⇔ f − Bω = ma ⇔ f − B = m 2
dt dt
dx
First order ODEs: = f ( x, t )
dt
Analytical solution: Explicit formula for x(t) (a solution which can be found
dx
using separate variables, integrating factor…) which satisfies = f ( x, t )
dt
Example:
dx
The ODE = a has as a solution x(t ) = at .
dt
dx
First order Initial Value Problem : = f ( x, t ), x(t 0 ) = x0
dt
dx
Analytical solution: Explicit formula for x(t) which satisfies = f ( x, t )
dt
and passes through x0 when t = t0
Example:
dx
= a ⇔ ∫ dx = ∫ adt ⇔ x(t ) = at + C ⇒ x(0 ) = C ⇒ x(t ) = at + x0
dt
For that reason a different symbol is used for the above solution: φ (t , t 0 , x0 ) .
You must be clear about the difference to an ODE and the solution to an
IVP! From now on we will just study IVP unless otherwise explicitly
mentioned.
In order to improve the presentation of our results I set in the “Save data to
workspace” option the following:
That way, once we run the simulation, we have in the command window the
matrix s which has in tits first column the values of the time and in the
second the values of our solution:
>> plot(s(:,1),s(:,2))
0.115
0.11
0.105
0.1
0.095
0.09
0 1 2 3 4 5 6 7 8 9 10
Example: x'+ kx = u
Numerical Solution:
k=5, u=0.5
Gain
1
0.5 s
Constant Integrator Scope
0.1
0.08
0.06
0.04
0.02
0
0 1 2 3 4
k=0.5, u=sin(10t)
Gain
0.5
1
s
Sine Wave Integrator Scope
0.2
0.15
0.1
0.05
-0.05
-0.1
0 5 10
Analytical Solutions:
kdt k = const kt
e∫ = e
( )
e kt ( x'+ kx ) = e kt u ⇒ e kt x ' = e kt u
( )
⇒ ∫ e kt x ' dt = ∫ e kt udt
⇒ e kt x = ∫ e kt udt + c ⇒ x = e − kt ∫ e kt udt + e − kt c
t
or: x = e −kt
x(0 ) + e −kt
∫e
kt1
udt1
0
t
x=e −kt
x(0 ) + e −kt
∫e
kt1
udt1
0
Assuming that k>0 the first part is called transient and the second is called
steady state solution.
~ y = ke jωt
y '+ k~
( )
y e kt ' = ke(k + jωt )
Integrating factor: e kt => ~
e (k + jωt ) ⇒
~ k
y e kt =
k + j ωt
k
~
y= e jωt ⇒
k + jωt
⎛ −1(ω ) ⎞
1 j ⎜ ωt − tan k
⎟
~
y= e ⎝ ⎠
1+ ω
2
k2
⎛ ⎛ −1(ω ) ⎞ ⎞
⎜ k ⎟⎟
−1(ω ) ⎞
j ⎜⎜ ωt − tan
1 ⎟ 1 ⎛
Re( y ) = Re⎜
~ e ⎝ ⎠⎟= cos⎜ ωt − tan k
⎟
⎜ ⎟ ⎝ ⎠
⎜ 1+ ω 2 1+ ω 2
2 2
⎟
⎝ k ⎠ k
1 ⎛ −1(ω ) ⎞
cos⎜ ωt − tan k ⎟
1+ ω
2 ⎝ ⎠
k2
Example:
Gain2 X0
-1 eu 0.1
Clock
Math
Function
Gain3
Scope1
1 eu
Clock1 Product1
Math 1
Function1 s
Product Integrator1
Sine Wave1
0.25
Steady
state Overall Transient
0.2
0.15
0.1
0.05
-0.05
-0.1
-0.15
-0.2
0 2 4 6 8 10
Exercise: Find the response for k=0.5, u=1 and u=-1, initial conditions: 0, 1,
-1. Describe the system’s behaviour.
Autonomous 1st order ODEs => Liner Time Invariant (LTI) systems
dx
= f (x) (not t on RHS).
dt
Analytic solution: Can be solved as before: Transient and steady state part.
d 2x
Second order ODEs: 2 = f ( x' , x, t )
dt
Second order linear ODEs with constant coefficients: x' '+ Ax'+ Bx = u
x' '+ Ax'+ Bx = 0 , assume x = e rt => x' = re rt & x' ' = r 2 e rt =>
− A ± A2 − 4B
r= , these are the Characteristic values or Eigenvalues.
2
Example:
Numerical Solution:
4
Check ICs
Gain5
1 1
s s
Integrator3 Integrator2 Scope
Gain1
0.8
0.6
0.4
0.2
0
0 5 10
Analytical Solution:
Gain2 Gain3
-3 eu -0.5
t Scope2
Clock Math
Function
Scope1
Gain4 Gain6
-1 eu 3/2
Math
Function1 Scope3
1.5
Overall
1 Part 2
0.5
Part 1
-0.5
0 5 10
Example:
Numerical Solution
2
Check ICs
Gain5
1 1
s s
Integrator3 Integrator2 Scope
Gain1
Analytical Solution
Gain2 Gain3
-1 eu 1
t
Clock Math
Function
Gain6
Scope1
1
t*exp()
Product
0.9 e-t
0.8
te-t
0.7 overall
0.6
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10
Theorem: If x is a complex solution to a real ODE then Re(x) and Im(x) are
the real solutions of the ODE:
, & φ = tan −1 ⎛⎜ ⎞
c1 c2
where G =
⎝ c1 ⎟⎠
cos⎛⎜ tan −1 ⎛⎜ 2 ⎞⎟ ⎞⎟
c
⎝ ⎝ c1 ⎠⎠
Numerical Solution
1
Check ICs
Gain5
1 1
s s
Integrator3 Integrator2 Scope
Gain1
Analytical Solution
Gain2
u
-0.5 e
t
Clock
Math
Function Product Scope1
Gain3
Gain4
sqrt(3)/2 cos 1
bt
Trigonometric
Function
Gain6
sin 1/sqrt(3)
Trigonometric
Function1
1.5
C 1 cos(bt)
C 1 cos(bt)+C 2 sin(bt)
0.5
-0.5
C 2 sin(bt)
-1
-1.5
0 2 4 6 8 10
1.5
1 eat
C 1cos(bt)+C 2sin(bt)
0.5
-0.5
Overall
-1
-1.5
0 2 4 6 8 10
0
Check ICs
Gain5
1 1
s s
Integrator3 Integrator2 Scope
Gain1
Gain2
u
0 e
t
Clock
Math
Function Product Scope1
Gain3
Gain4
1 cos 1
bt
Trigonometric
Function
Gain6
sin 0
Trigonometric
Function1
0.8
0.6
0.4 Overall
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 2 4 6 8 10
In all previous cases if the real part is positive then the solution will diverge
to infinity and the ODE (and hence the system) is called unstable.
Root Space
jb
jb
a
a
e k1t , e k 2 t , k1 , k 2 < 0
Critically No Two exponentials:
damped
e kt , te kt , k < 0
Underdamped Yes One exponential and one
cosine e kt , cos(ωt ) , k < 0
Undamped Yes one cosine cos(ωt )
− A ± A 2 − 4 B − 2ζω n ± (2ζω n )2 − 4ω n2
r= =
2 2
r = −ζω n ± ζ 2ω n2 − ω n2
ζ >0
1. Real and unequal ζ 2ω n2 > ω n2 ⇔ ζ 2 > 1 ⇒ ζ > 1 => Overdamped system
implies ζ < 1 ;
5. In all the previous cases if ζ > 0 then the transient part tends to zero. If
ζ <0 then the system will diverge to infinity with or without
oscillations.
Example:
1 1
s s
Integrator1 Integrator Scope
Gain1
2
Constant
Gain2
Scope2
u
-0.5 e
t exp(-at)
Clock Scope1
M ath
Function
Gain4 Gain5
Product
Scope3
2.5
1.5
Particular solution
Overall
1
Homogeneous solution
0.5
-0.5
-1
0 2 4 6 8 10