You are on page 1of 9

Pendulums and Elliptic Integrals v2.

doc 1

m mass of pendulum
Pendulums and Elliptic Integrals R length of pendulum
g acceleration of gravity (e.g., 9.81 m/s2)
James A. Crawford α starting angle

If we assume that the pendulum arm itself is


both rigid and of zero mass, it is convenient to think
1. Introduction about the motion of the pendulum bob in terms of
motion along the fixed radius R where the angle ϕ is a
function of time. The tangential force perpendicular to
Many years ago before the advent of the “PC R that the weight of the bob creates is given by
on every desktop” age, I became fascinated with the
design of LC1 elliptic filters. As part of that endeavor, I
also became intimately acquainted with elliptic
FT = mg sin (ϕ ) (1)
integrals. Having an equal intrigue for numerical
precision, I found that computing the elliptic integrals From Newton’s Laws of motion, this tangential force
with high accuracy was very difficult if simple must be associated with a tangential acceleration which
integration methods like Simpson’s Rule or Gaussian can be written as
quadrature were resorted to. Thus began my search for a
precision method of computations.  dv  d  dϕ 
Some readers will no doubt be familiar with FT = maT = m  T  = m R 
the solution path involved, but to those who are not, I  dt  dt  dt 
(2)
invite you to read on. d 2ϕ
= mR 2
dt
Proper attention to signs for the forces involved results
2. Where Hence Elliptic in the describing differential equation in terms of ϕ
given as
Integrals?
d 2ϕ g
Elliptic integrals show up in many places, − sin (ϕ ) = 0 (3)
electronic elliptic filters for one. One of the situations dt 2 R
where people encounter them first is in connection with
simple pendulum motion. If the angular extents allowed for the pendulum swing
are kept small, we can approximate sin (ϕ ) ≈ ϕ
Figure 1 Classical Pendulum which leads to the very simple differential equation

d 2ϕ g
− ϕ =0 (4)
dt 2 R
If we now hypothesize that the solution to this
R differential equation is given by ϕ ( t ) = A sin (ω ot )
α and substitute into (4), we quickly see that this is indeed
the correct solution with
ϕ

g
∆ PE ωo = (5)
FT
R
W= m g

A classical pendulum is shown in Figure 1 Returning now to the original nonlinear


where differential equation (3), this can be pursued further by
multiplying both sides of the equation by
dθ / dt which creates
1
LC for inductor-capacitor

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 2

 d 2ϕ  dϕ dϕ
 2  = ω o2 sin (ϕ ) (6) Substituting (13) into (11) leads finally to
 dt  dt dt
π /2
R dθ
and integrating both sides with respect to time results in T=4
g ∫
0 1 − k sin 2 (θ )
2
(14)

2
1  dϕ 
 − ω o cos (ϕ ) = k
2
 (7)
2  dt  The integral involved in (14) is an elliptic
integral of the first kind. With k = sin (α /2 ) , the
where k is a constant of integration. Assuming that the
pendulum has a maximal displacement of angle ϕ = α , integral is very well behaved because k is always <

then ϕ ' (α ) = 0 , and solving for the derivative and 2 /2 . In the case of elliptic filter usage however, k
taking the positive root leads to is often very close to unity thereby making numerical
evaluation of (14) considerably more challenging.

= ω o 2 cos (ϕ ) − cos (α ) (8)
dt
Aside: Conservation of energy may be used to quickly
Integrating one more time produces arrive at the same starting point represented by (8). The
change of potential energy that occurs from angular
dϕ position α to ϕ can be equated to the increase in kinetic
∫ 2 cos (ϕ ) − cos (α )
= ω ot (9) energy (since the bob is momentarily motionless at
angular position α) as

The time required for ϕ to increase from 0 to α is 1


mv 2 = mgR cos (ϕ ) − cos (α ) (15)
α
2
T R dϕ
4
= ∫
2 g 0 cos (ϕ ) − cos (α )
(10) Since the velocity v must be tangential to the arc that is
scribed by the bob, at any instant in time
v = R ( dϕ / dt ) . Substituting this into (15) leads
Using the identities cos (ϕ ) = 1 − 2 sin 2 (ϕ /2 ) directly to (8).
and cos (α ) = 1 − 2 sin (α /2 ) in (10) leads to
2
The elliptic integral of the first kind is
α
generally presented as
R dϕ
T =2 ∫
g 0 k − sin 2 (ϕ /2 )
2
(11) x

F ( k, x) = ∫ (16)
0 1 − k 2 sin 2 (θ )
with k = sin (α /2 ) . A new variable can be defined
as sin (ϕ /2 ) = k sin (θ ) from which
with the complete elliptic integral of the first kind given
by F(k,π/2). It is easy to show that

 ϕ  dϕ R
cos   = k cos (θ ) dθ (12) T = 2π
2 2 g (17)
which upon re-arrangement gives 2 2
  1  2  1i3  4  1i3i5  6 2

1 +   k +   k +  k + …
  2   2 i 4   2 i 4 i 6  
2 k cos (θ ) dθ 2 k − sin (ϕ /2 ) (13)
2 2

dϕ = =
ϕ 1 − k 2 sin 2 (θ )
cos  
2

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 3

Straight forward visual inspection of (17) easily shows a0 = 1 + k


that the series is slow to converge when k is reasonably
close to unity. b0 = 1 − k
Re cursively Compute :
ai + bi
3. Accurate Computation of ai + 1 = (20)
2
the Elliptic Integral of the
bi + 1 = ai bi
First Kind
Upon Convergence :
Gauss’s Transformation2 can be used to expand π  π
the elliptic integral (16) into an expansion where F ,k =
 2  2 an
F (ϕ , k ) = ( 1 + k 1 ) F (φ 1 , k 1 ) (18)

This expansion can be repeatedly applied ultimately


π 4. Comparison or Linearized
leading in the limit to
p →∞
(
lim F φp , k p = ) 2
. The
Model Results with Ideal
expansion generally converges to 10 or more decimal
place accuracy within only a few recursions of (18). All of the mathematics are greatly simplified if
The other formulas that accompany (18) are the the linearized model represented by (4) is used rather
following: than the complete nonlinear model. For the linearized
case, the frequency of the pendulum’s motion is exactly
computable as (5) and the pendulum’s motion is
k ' = 1 − k2 precisely sinusoidal.
1− k' For a very large range of starting phases, the
k1 = (19) pendulum’s motion is very closely approximated by a
1+ k' sinusoid assuming the time period given by (14). In all
 ( 1 + k ') sin (φ )  but the most rigorous cases, this is in all likelihood
φ1 = arcsin   adequately precise.
 1 + 1 − k 2 sin 2 (φ )  The appreciation for the linear differential
equation represented by (4) is quickly appreciated over
the nonlinear differential equation (3) when implicit and
In the case where the complete elliptic integral
or higher-order numerical solutions of the differential
of the first kind is to be computed (i.e., ϕ = π /2 ), a equation are desired for greater accuracy. The author
different set of recursive formulas [7] can be used to has frequently used the second-order Gear method [5]
compute the desired result with even less effort as given with good success, but this formulation is not possible
by with the nonlinear differential equation (3).

5. Numerical Solution of the


Differential Equations
The differential equation (3) solution may be
computed numerically in the time domain.

5.1 Forward Euler Integration


Although prone to accuracy and stability
2 issues, the forward Euler method is often used for
Also referred to as Landen’s Transformation

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 4

solving differential equations because it is extremely shows. Error propagation with the forward Euler
simple to use. The forward Euler method is an explicit method is so poor that the amplitude growth is difficult
integration method [5-6]. In this case, the time- to avoid.
derivative is approximated as
Figure 2 Forward Euler Differential Equation
Solution
s (t + h ) − s (t )
s '(t ) ≈ (21) Pendulum Swing in Time Domain
h 0.8
Tp
0.6
where the time increment is given by h. Focusing on the
starting differential equation (3), it is simple to re-cast 0.4
this second-order differential equation as a pair of first-
order differential equations by defining 0.2

Phase, rad.
U 1 (t ) = ϕ (t )
0


0.2
(22)
U 2 (t ) =
dt 0.4

leading to 0.6

dU 2 g 0.8
= − sin (U 1 )
0 2 4 6 8 10 12 14 16
Time, sec
dt R Forward Euler Computed
(23) Ideal
dU 1
= U2
dt
Substituting (21) into (23) results in
5.2 Backward Euler Integration
U 2 n+1 − U 2 n g
= − sin (U 1n ) Backward Euler integration is an implicit
h R integration method and as such, it is not possible to use
(24)
U 1n + 1 − U 1n this method unless the differential equation is linearized
= U 1n as in (4). Although this is a short-cut path that we wish
h
where the index n represents the value of the parameter to avoid, this path will be considered in order to show
at time t= nh where h is the constant time step used. the greater stability properties of the backward Euler
Solving (24) for the parameter values at the next time method as compared to the forward Euler method.
step n+1 produces For the backward Euler method we write

gh
 gh  U 2 n+1 = U 2 n − U 1n+ 1
U 2 n+ 1 = U 2 n +  −  sin (U 1n ) R (26)
 R (25)
U 1n+ 1 = U 1n + hU 2 n+ 1
U 1n + 1 = U 1n + U 2 n h
or in matrix form
The fact that the forward Euler method is an explicit
method results in only time-index n values being on the
 gh 
right side of the equal side and the n+1 (future) time-
R 1  U 1n+ 1  U 2 n 
index values being on the left-hand side. = (27)
The set of difference equations can be easily   U 2 n+ 1  U 1n 
 1 −h 
programmed and in the case of R= 1 meter and α= 30
degrees, the result is as shown in Figure 2. Due to
numerical imprecision even with h= 6msec, the
computed solution slowly grows in amplitude rather Solving this for the next-step state-variable values,
than remaining constant-envelope as the ideal solution

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 5

h 1  5.3.1 Second-Order Runge-Kutta


 U 2 n 
gh  
 1 −  U 1n  The formula for the second-order Runge-Kutta
U 1
 n+1   R
U 2  = gh 2
(28) solution to the second-order differential equation are
given by
 n+ 1  1+
R
k1 = f ( t n , x n , y n )
This set of simultaneous difference equations can be
programmed very easily also leading to the results j1 = g ( t n , x n , y n )
shown in Figure 3. In the backward Euler case, the h h h
Figure 3 Backward Euler Differential Equation
k2 = f  tn + , xn + k1 , y n + j1 
 2 2 2  (29)
Solution
 h h h 
Pendulum Swing in Time Domain j 2 = g  t n + , x n + k 1 , y n + j1 
0.8
 2 2 2 
Tp
0.6 xn+ 1 = xn + hk2
0.4 yn+ 1 = yn + hj2
0.2

In the context of the present set of differential equations,


Phase, rad.

0.2 U 1 (t ) = ϕ (t )
0.4 dϕ
U 2 (t ) =
0.6 dt
dU 2 g
= f ( ... ) = − sin (U 1 )
0.8
(30)
1
0 2 4 6 8 10 12 14 16
dt R
Time, sec dU 1
Forward Euler Computed = g ( ...) = U 2
Ideal
Linearized Backward Euler
dt

which leads further to


g
numerical imprecision leads to a decay in the envelope k1 = − sin (U 1n )
magnitude, so although this is clearly a more stable R
situation, the extent of the numerical error is about the j1 = U 2 n
same as for the forward Euler method.
In the section that follows, we will see that the g  h 
4th order Runge-Kutta method is dramatically more
k2 = − sin  U 1n + j1 
R  2  (31)
accurate and well behaved than either Euler method
considered thus far. h
j2 = U 2 n + k1
2
U 1n+ 1 = U 1n + hj2
5.3 Runge-Kutta Method
U 2 n+ 1 = U 2 n + hk2
The derivation of the Runge-Kutta method is
beyond the scope of this memorandum, but interested These finite difference equations are easily programmed
readers may refer to [4,6]. Results for the second-order and the results for several different time steps are shown
and fourth-order Runge-Kutta methods applied to the in Figure 4 through Figure 6. As shown in these figures,
second-order differential equation (3) follow. the results follow the exact solution very closely until
the time step is increased too far to 200 msec as shown

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 6

in Figure 6 where the onset of some instability is Figure 6 2nd Order Runge-Kutta with h= 200 msec
apparent.
2nd Order Runge-Kutta
1.5
Tp
Figure 4 2nd Order Runge-Kutta with h= 30 msec
1
2nd Order Runge-Kutta
0.6
Tp 0.5

Phase, rad.
0.4
0

0.2
0.5
Phase, rad.

0
1

0.2
1.5
0 2 4 6 8 10 12 14 16
0.4 Time, sec
2nd Order Runge-Kutta
Ideal
0.6
0 2 4 6 8 10 12 14 16
Time, sec
2nd Order Runge-Kutta
Ideal

Figure 5 2nd Order Runge-Kutta with h= 75 msec


2nd Order Runge-Kutta
0.6
Tp

0.4

0.2
Phase, rad.

0.2

0.4

0.6
0 2 4 6 8 10 12 14 16
Time, sec
2nd Order Runge-Kutta
Ideal

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 7

Figure 7 4th Order Runge-Kutta with h= 30 msec


4th Order Runge-Kutta
5.3.2 Fourth-Order Runge-Kutta 0.6
Tp

th
In the case of the 4 -order Runge-Kutta 0.4

method, the applicable formulas are as follows:


0.2

Phase, rad.
k1 = f ( t n , x n , y n ) 0

j1 = g ( t n , x n , y n ) 0.2

h h h
k2 = f  tn + , xn + k1 , yn + j1  0.4

 2 2 2 
 h h h  0.6
0 2 4 6 8 10 12 14 16
j 2 = g  t n + , x n + k 1 , y n + j1  Time, sec
 2 2 2  4th Order Runge-Kutta
Ideal
h h h
k3 = f  tn + , xn + k2 , yn + j2 
 2 2 2 
 h h h  Figure 8 4th Order Runge-Kutta with h= 75 msec
j3 = g  t n + , x n + k 2 , y n + j2 
 2 2 2  4th Order Runge-Kutta
k4 = f ( tn + h , xn + hk3 , y n + hj3 )
0.6
Tp

j4 = g ( tn + h , xn + hk3 , yn + hj3 ) 0.4

h
xn + 1 = xn + ( k1 + 2 k 2 + 2 k 3 + k 4 ) 0.2

6
Phase, rad.

h 0

yn+1 = y n + ( j1 + 2 j 2 + 2 j 3 + j 4 ) (32)
6 0.2

This set of difference equations is easily programmed 0.4


and the results are shown for several time steps in
Figure 7 through Figure 9. As shown in these figures,
0.6
the computed results match the ideal results almost 0 2 4 6 8 10 12 14 16
Time, sec
exactly even at the large time step of 200 msec. 4th Order Runge-Kutta
Although other techniques may be superior to Ideal
the Runge-Kutta methods explored here, the simplicity
of the method combined with the very good precision
make it a highly recommended method for use in
solving differential equations numerically.

V2.0 2004 James A. Crawford


Pendulums and Elliptic Integrals v2.doc 8

Figure 9 4th Order Runge-Kutta with h= 200 msec


7. References
4th Order Runge-Kutta
0.6
Tp
1. I.S. Sokolnikoff, R.M Redheffer, Mathematics
of Physics and Modern Engineering, 1958,
0.4
McGraw-Hill Book Co.
2. Antoniou, Digital Filters: Analysis and
0.2
Design, 1979, McGraw-Hill Book Co.
3. R.W. Daniels, Approximation Methods for
Phase, rad.

0
Electronic Filter Design, 1974, McGraw-Hill
Book Co.
0.2 4. E. Kreyszig, Advanced Engineering
Mathematics, 3rd Edition, 1972, John Wiley &
0.4 Sons
5. J.A. Crawford, Frequency Synthesizer Design
0.6 Handbook, 1994, Artech House
0 2 4 6 8 10 12 14 16
Time, sec 6. C.F. Gerald, P.O. Wheatley, Applied
4th Order Runge-Kutta Numerical Analysis, 1970, Addison-Wesley
Ideal 7. F.R. Ruckdeschel, BASIC Scientific
Subroutines, Vol. II, 1981, BYTE Publications
8. P. Amstutz, “Elliptic Approximation and
Elliptic Filter Design on Small Computers”,
IEEE Trans. Circuits and Systems, December
6. Connections with Elliptic 1978
9. S. Darlington, “Simple Algorithms for Elliptic
Filters Filters and Generalizations Thereof”, IEEE
Trans. Circuits and Systems, December 1978
Two of the best treatments of elliptic filter 10. S. Darlington, “Network Synthesis Using
design are provided by [2,3,8]. Having been a long Tchebycheff Polynomial Series”, Bell System
admirer of Sidney Darlington’s work with elliptic Technical Journal, July 1952
filters, a number of his related publications are listed 11. S. Darlington, “A History of Network
here as references [9-13]. Synthesis and Filter Theory for Circuits
A very insightful and unifying view of Composed of Resistors, Inductors, and
Butterworth, Chebyshev, and elliptic filters is provided Capacitors”, IEEE Trans. Circuits and
in [9]. Quoting from [9]: Systems, January 1984
12. S. Darlington, “Analytical Approximations to
“Formulas for the critical frequencies involved with Approximations in the Chebyshev Sense”, Bell
the design of Butterworth, Chebyshev, and elliptic System Technical Journal, January 1970
filters are identical when expressed in terms of 13. S. Darlington, “Filters with Chebyshev
appropriate variables. For Butterworth filters, the Stopbands, Flat Passbands, and Impulse
appropriate variable is simply the frequency s = jω . Responses of Finite Duration”, IEEE Trans.
For Chebyshev filters, it is a new variable defined by a Circuits and Systems, December 1978
simple transformation on ω. For elliptic filters, the
appropriate variable is determined by a sequence of
transformations applied recursively, each similar to
that for the Chebyshev filters. Interpretation in terms
of elliptic function transformations is a possible but
unnecessary complication. “

This reference provides the most concise and simple


method for calculating the elliptic filter critical
frequencies that I am aware of.

V2.0 2004 James A. Crawford


Advanced Phase-Lock Techniques

James A. Crawford

2008

Artech House

510 pages, 480 figures, 1200 equations


CD-ROM with all MATLAB scripts

ISBN-13: 978-1-59693-140-4
ISBN-10: 1-59693-140-X

Chapter Brief Description Pages


1 Phase-Locked Systems—A High-Level Perspective 26
An expansive, multi-disciplined view of the PLL, its history, and its wide application.
2 Design Notes 44
A compilation of design notes and formulas that are developed in details separately in the
text. Includes an exhaustive list of closed-form results for the classic type-2 PLL, many of
which have not been published before.
3 Fundamental Limits 38
A detailed discussion of the many fundamental limits that PLL designers may have to be
attentive to or else never achieve their lofty performance objectives, e.g., Paley-Wiener
Criterion, Poisson Sum, Time-Bandwidth Product.
4 Noise in PLL-Based Systems 66
An extensive look at noise, its sources, and its modeling in PLL systems. Includes special
attention to 1/f noise, and the creation of custom noise sources that exhibit specific power
spectral densities.
5 System Performance 48
A detailed look at phase noise and clock-jitter, and their effects on system performance.
Attention given to transmitters, receivers, and specific signaling waveforms like OFDM, M-
QAM, M-PSK. Relationships between EVM and image suppression are presented for the first
time. The effect of phase noise on channel capacity and channel cutoff rate are also
developed.
6 Fundamental Concepts for Continuous-Time Systems 71
th
A thorough examination of the classical continuous-time PLL up through 4 -order. The
powerful Haggai constant phase-margin architecture is presented along with the type-3 PLL.
Pseudo-continuous PLL systems (the most common PLL type in use today) are examined
rigorously. Transient response calculation methods, 9 in total, are discussed in detail.
7 Fundamental Concepts for Sampled-Data Control Systems 32
A thorough discussion of sampling effects in continuous-time systems is developed in terms
th
of the z-transform, and closed-form results given through 4 -order.
8 Fractional-N Frequency Synthesizers 54
A historic look at the fractional-N frequency synthesis method based on the U.S. patent
record is first presented, followed by a thorough treatment of the concept based on ∆-Σ
methods.
9 Oscillators 62
An exhaustive look at oscillator fundamentals, configurations, and their use in PLL systems.
10 Clock and Data Recovery 52
Bit synchronization and clock recovery are developed in rigorous terms and compared to the
theoretical performance attainable as dictated by the Cramer-Rao bound.

You might also like