Академический Документы
Профессиональный Документы
Культура Документы
August 1970
mw
THE SIMULTANEOUS
DIFFERENTIAL
NUMERICAL
- ALGEBRAIC
SOLUTION OF
EQUATIONS*
C. W. Gear**
Stanford Linear Accelerator Center
Stanford University, Stanford, California 94305
and
Computer Science Department
Stanford University, Stanford, California
on Circuit
94305
Theory.)
(Revised)
ABSTRACT
This paper discusses a unified method for handling the mixed differential
and algebraic
analysis
differential
equations written
In the second part one of these techniques is applied to the problem F(y, y, t) = 0.
This may be either a differential
zero or zero.
It will represent
components of a system.
or an algebraic
equation as dF/8y*
dF/ay*
is non-
I.
Many problems
in transient
INTRODUCTION
network analysis and continuous system simu-,
differential
set of algebraic
are to be evaluated.
differential
equations is
g =f@, t)
where w is a vector of dependent variables,
(1)
Most methods
of w.
system of differential
and algebraic
t)
(2)
0 = gt&,.!& t)
where u is a vector of the same dimension as g (but not necessarily
the same as
WI
A simple method for ,initial value problems
form
where h = tn - t
n-l
(4)
must be solved for -n-l
u
-2-
The properties
Differential
encountered are:
Equations
Large
Sparse
Stiff
Algebraic
Equations
Large
Sparse
Mildly Nonlinear
By sparse we mean that only a few of the variables w and 2 appear in any one of
the functionsf
present,
org.
variables
it is typically
with 2 = -w
are widely
time constants
cause the
are
time steps to
step.
A further
complication
1 occur implicitly
t) = 0. (This complication
does not occur in network analysis since techniques have been developed to generate
equations in which the derivatives
are explicit,
neces-
In order to portray
the characteristics
we represent
t) + Pv
(5)
set of s1 = s - s2 variables.
(ii)
(iii)
Writing
solution may
that
P is an s by s2 matrix of constants,
without derivatives.
is),
the equations in form (2) may destroy the sparseness and hence
P by row interchanges
into an s1 by s2 matrix
1
(This is possible if the system (5) has a unique solution.)
(6)
0 = q&Y,
t) -
PIP2
-1
Hz&~, t) = ,JQ& t)
-4-
(7)
for stiff equations involve the use of the Jacobians of the system, we do not normally
want to make this transformation
unless SI is small.
of the variables
STIFF DIFFERENTIAL
exploit the
v.
EQUATIONS
of numerical
rule analyzed by
= AK +2(t)
(8)
The
equations
w = hiW,
i= 1,2,...,n
A.
(9)
Since the solution of (8) is
given by
x(t) = eAt&40) - kg) f&t)
we are concerned about restricting
numerical solution compared to the largest growth rate of either b(t) or any of
h.t
the e 1 . Such stability restrictions are dependent on the problem being solved
and are hence not useful ones for picking methods suitable for large classes of
problems.
Dahlquist
-5I
approximation
multistep
positive.
coefficient
rule.
For
Dahlquist A-stability
For the remainder
criteria
if multistep
in Figs. 1 and 2.
Figure 1
equation
w = h(w - F(t))+F(t)
(10)
Some
of the members of the family of solutions are shown in Fig. 1. The Euler method
projects
turbations
from the solutions which tend rapidly to F(t) are amplified rapidly unless
h is very small.
amplification
is a factor of (1 + M) at each
=w
n-l + h f(Y, $J
(11)
It is
equivalent to finding the member of the family of solutions for which the tangent
at tn passes through (wn 1, tn _ 1). The error
is amplified
by l/(1 - M) at each
explicit
-6-
or equivalently,
include the Implicit
make
=w
n-l
The application
+ ...
(12)
>
to requiring
A-stability
These correspond
to oscillating
components that
It will therefore
be necessary
to reduce h such that successive values of tn occur at least about 10 times per
cycle.
Methods that were stable for all values of M to the left of Re(M) = -D
The multistep
stable.
= alwn-l
+ . . . + akwn-k
(13)
+ q-p:,
by the requirement
Unfortunately
can be used.
If the first
explicit predictor
few iterations
are needed.
formula,
iteration
In
the first
Since Newtons
-7-
corrector
in a
and alge-
braic equations.
used as follows:
.iG
= c!ilwn-l
n
Subtracting
+ . . . + ctkWnak +Fp:,
_1
Gn
PO
f(w,t
tn)
(YIWnwl*
Ykwn&
+$wl
where
yi=(
i - ~i)/PO
and
Let us use the symbol hEn for YiWn 1 -t . . . + ykwn k + Slhw6 ,,: Thus we have
r
-I
and, trivially,
hwh = hFn f
T
where T is the transpose
Define the vector gn to be wn, hw:, wn 1, . . . , wn k+l
[
operator, and gn to be Gn, h9$, w
- Then we can write
n-l wn-k+l
- ;r1
1
con=i.I&+c
-8-
/ (15)
where
g=
I.
p,, 1, 0, . . . . 0 T
81 Pl
- z,...z
y1
B=
i
k-l
.
zk
y2
* yk-1.
Yk
. ..o
. ..o
*
\,
-...l
and b = hf(w,, tn) - hEh is a scalar such-that (15) satisfies hf(wn, tn) - hw = 0.
[
(Here hwh is the second component of U+ given by (15). ) We can subject (14) and
(15) to nonsingnlar
linear transformations.
ponents of gn represent
W .,
In particular,
a unique polynomial
-1
the same
an-1 = A an,1
a =Qw =Qgn+Qcb=zn+Jb
-n
-t-n
(16)
where A = Q B Q-l 1s
* shown to be the Pascal triangle matrix in Ref. 7, and the
values of 11= Q c are given in Ref. 6 for stiff methods of various orders.
We can determine
b from
0 = h f(w,, tn) - hwh
= Fen, tn)
(by definition)
-9-
(17)
starting
from b
(0)
= 0, we get
(18)
1- Fbtrn$
where
p(b) = F(ZX +a b, tn)
Writing
we get
-gn, (0)
= A&l
ij
Fen,(m)
(19)
tn)
where ai is the ith component of a, numbering from 0. We now note that this
technique is not dependent on,the differential
form (1).
Errors
in the numericalsolution,
in these approximations
do not
of (19).
III.
ALGEBRAIC
EQUATIONS
algebraic
%I
= alwnll
-t . . . + akq,.k
+ h PO ftxn,zn,
trill
tnl
Calahan. and Hachtel g 1.)
The interesting
10
do this by a simultaneous
system
0 = gtq&y
Newton iteration,
algorithm
previous time steps tnmi, 15. i I k + 1 we can approximate 7in = u(tn) by extrapohtion, that is by evaluating the unique k th degree polynomial
these unei.
un we have
T
ii
n
ln-l
rlk+l
unmk+l
We write
&n=
-
- 1
72 ,...,
n
-1
unk+l
We then have
ii&= E En-1
(20)
where
11
r72
1
0
0
1
...
0
-* *
r)k
?k+l
0
0
0
0
...
...
we can write
(21)
L!,=!!&+eb
b is such that &n satisfies
(by definition)
=GGn+eb,
We can represent
U
tn)=O
at tn-l,
- 11 -
(22)
from
.En-l=
n-l,hu;ml,.
formation
. .,hkuEl/x]T.
S to obtainan
1 = S ~~-1
-n=
3.
linear trans-
Sgn= S E S-za+
-%
The matrix
= i& + S e .b
S E S-l is
* the Pascal triangle
to the vector1
(see Ref. 11) so these equations are identical to Eq. (16) derived
for differential
equations.
Therefore,
iteration
MIXED SYSTEMS
equation.
The prediction
appears in (19)
in the cases.
equation if BK/@w f 0,
, t) = 0
step is
a1 = A a
-n
-n- 1
- 12 -
iteration
(19) is
variables,
appropriate
If the
iteration.
at each
step.
the partition
3,
%l
w0
+
61
--%I-
of the
Initial errors
in v
do not affect the corrector itera-n, t 0)
or differential equations. This can be seen by
%
h
Iteration
=
1
p I
10
-pO
p2Qo
where Ax, = 1
n, tm+l) - En, (3
and Ax is similar.
-1
plp2
I
- 13 -
39,~,
Premultiply
t) + 351
this by
to get
I
The first
the errors
inv do not
Prediction
no computation
PROGRAM ORGANIZATION
of a subroutine which
.
(This subroutine
generates the values of the vectors 2: from the values of&i.
is available from the author,
inadequately documented.
differential
although it is currently
experimental,
If that is,
The subroutine calls on a lower level user supplied subroutine which must
evaluate the components of I3&,1,
It chooses the order of the method and the step size automatically.
accomplished
by setting the order of the method to one so that the only components
Starting is
If corrections
The program
flow is
of 4 to try and get into the region of convergence for Newtons method.
- 14 -
is
When
small corrections
error.
and corrector
If the error
is acceptable,
largest of these is chosen for the next step, and the appropriate
Details of this and many other minor problems
integration
ferential
algorithm
equations,
are similar
A NUMERICAL
example is artificial
EXAMPLE
order is selected.
The following
The
4
0 = yi - s + (r - yi)2 + c bij yj
j=l
for i = 1 to 4
where
r = (Y, + y2 + y3 + ~~112
4
s= C
i=l
(r - ~~)~/2
- 15 -
(26)
matrix with
b
11
The starting
= F7
0 = v1 + v2 + 5yly2 = F8
(27)
differential
0 = Y5 + Y&
(28)
= F5
It is not immediately
- 16 -
the
of equations,
equilibrium.
digit.)
-10 ,
by t = 1000, the system was approaching
A conventional
the differential
integration
equations.
equation
control parameter.)
SUMMARY
I
Xf the mathematical
the numerical
method pre-
sented will compute it, although for badly conditioned problems the step size may
be small.
the
method will follow the one smoothly connected to the initial values as long as the
multiple
through a multiple
iteration
In some cases
near a multiple
to the program.)
criteria.
Currently
solution of
an investigation
of
equations is
It is expected that this will make it possible to use the same program
- 17 -
equations is identical.
between them.
and differential
variables,
making
consequences
since it will no longer be necessary to manipulate the equations into a text book
form.
- 18 -
REFERENCESANDFOOTNOTES
1.
G. Dahlquist,
B. I. T. 3, 27-43 (1967).
2.
B. L. Ehle, B.I.T.
S, 276-278 (1968).
3.
H. H. Rosenbrock,
4.
5.
R. H. Allen,
linearized
Runge-Kutta
dl-82-0929
6.
llNumerically
p. 744 (1968).
stable explicit
integration
Processing
of stiff ordinary
Document
differential
equations, I1
Co. ,
1969); p. 187-193.
7.
8.
C. W. Gear, An algorithm
considerations
of ordinary
differential
equations, I
section).
in the transient
techniques using a
Amsterdam,
10.
for nonlinear
(1969).
Information
9.
integration
(1969).
QBQ
-1
-1
and S E S are both the Pascal triangle matrix
representations,
as does A.
be equivalent.
numerical
equations.
amplification
inanel).will
at tn is independent of earlier
equation.
the vector1
is
hence1
- 20 -
of ordinary
differential
equations, II
1.7 - 9
1.0-5
1.1-5
1.1-6
4.7 - 7
3.8-S
1.0-8
1.0-4
1.0-5
1.0-6
1.0-7
1.0-8
6.2 - 8
1.0-7
4.8-7
3.8 - 5
2.7 - 7
4*
Max. Error
inyl to y4
1.0-6
mm1.0-5
l.O-
Zrror Control
Parameter
5.3-5
1.4-6
2.0-5
4.7 - 4
3.3 - 3
2.8-8
2.7 - 7
3.3 - 7
1.8-6
1.2 - 7
IF51
12
11
3.6-15
3.8 - 13
1.6-
4.9 - 10
2.0-
7.3-13
3.4 - 11
7.5 - 10
2.2 - 9
IF61
10
12
3.6 - 15
1.2 - 13
2.1-
IF81
10
2.2 - 16
2.2 - 16
6.7 - 15
2.5--
3.2 - 13
13
11
7.1-
15
3.6 - 15
2.1-
2.0-
4.2 - 11
t= 1000.
13
4.5 - 12
5.0-
7.8 - 12
4.4 - 11
5.4-
t=.01
IF71
TABLE1
530
379
305
214
168
137
85
70
55
41
No. Steps
2894
1779
1389
1059
937
608
377
270
235
197
No. Equation
Evaluations
138
75
61
53
54
27
18
13
13
12
r No. Jacobiar
Evaluations
ti
1552A2
Fig. 2
Backward Euler solution of (lo),
W-
ENTRY
I
Compute D=
H(y,y,t)
+Pv
No
lnvana of Jocobkm
i
Estimoe Error by
Pmdictw Cwrector
Difference
l
fl
YSS
Choose Order
ond Step Size
for Next Step
Fig.
Program
organization.