PDF Ordinary and Partial Differential Equation Routines in C C Fortran Java Maple and MATLAB 1st Edition H.J. Lee download
PDF Ordinary and Partial Differential Equation Routines in C C Fortran Java Maple and MATLAB 1st Edition H.J. Lee download
com
https://ebookname.com/product/ordinary-and-partial-
differential-equation-routines-in-c-c-fortran-java-maple-
and-matlab-1st-edition-h-j-lee/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/partial-differential-equations-and-
fluid-mechanics-1st-edition-james-c-robinson/
ebookname.com
https://ebookname.com/product/groundwater-4th-edition-frederick-
bloetscher/
ebookname.com
Computers thinking and learning inspiring students with
technology David Clive Nettelbeck
https://ebookname.com/product/computers-thinking-and-learning-
inspiring-students-with-technology-david-clive-nettelbeck/
ebookname.com
https://ebookname.com/product/microporomechanics-1st-edition-luc-
dormieux/
ebookname.com
https://ebookname.com/product/history-of-wireless-1st-edition-tapan-k-
sarkar/
ebookname.com
https://ebookname.com/product/progress-in-drug-research-1st-edition-
hao-wu/
ebookname.com
https://ebookname.com/product/the-macroeconomics-of-global-imbalances-
european-and-asian-perspectives-1st-edition-marc-uzan/
ebookname.com
Español avanzado A Textbook for Advanced Level Caribbean
Students Paulette Ramsay
https://ebookname.com/product/espanol-avanzado-a-textbook-for-
advanced-level-caribbean-students-paulette-ramsay/
ebookname.com
Ordinary and Partial Differential
Equation Routines in C, C++,
Fortran, Java®, Maple®, and MATLAB®
H.J. Lee and W.E. Schiesser
H. J. Lee
W. E. Schiesser
Bethlehem, PA
The central topic of this book is the programming and use of a set of li-
brary routines for the numerical solution (integration) of systems of initial
value ordinary differential equations (ODEs). We start by reviewing some
of the basic concepts of ODEs, including methods of integration, that are
the mathematical foundation for an understanding of the ODE integration
routines.
dy
= f (y, t), y(t0 ) = y0 (1.1)(1.2)
dt
where
y= dependent variable
t= independent variable
f (y, t) = derivative function
t0 = initial value of the independent variable
y0 = initial value of the dependent variable
Equations 1.1 and 1.2 will be termed a 1x1 problem (one equation in one un-
known). The solution of this 1x1 problem is the dependent variable as a function
of the independent variable, y(t) (this function when substituted into Equations
1.1 and 1.2 satisfies these equations). This solution may be a mathematical
function, termed an analytical solution.
Term Explanation
Differential equation Equation 1.3 has a derivative dy/dt = f (y, t) = λe −αt y
Ordinary Equation 1.3 has only one independent variable, t, so that
the derivative dy/dt is a total or ordinary derivative
First-order The highest-order derivative is first order (dy/dt is
first order)
Linear y and its derivative dy/dt are to the first power; thus,
Equation 1.3 is also termed first degree (do not confuse
order and degree)
Variable coefficient The coefficient e −αt is a function of the independent
variable, t (if it were a function of the dependent
variable, y, Equation 1.3 would be nonlinear or not
first degree)
y1 (t) = c 1 e λt
(1.7)
y2 (t) = c 2 e λt
where c 1, c 2 , and λ are constants to be determined, substitution of Equations
1.7 in Equations 1.6 gives
c 1 λe λt = a 11 c 1 e λt + a 12 c 2 e λt
c 2 λe λt = a 21 c 1 e λt + a 22 c 2 e λt
Cancellation of e λt gives a system of algebraic equations (this is the reason
assuming exponential solutions works in the case of linear, constant coefficient
ODEs)
c 1 λ = a 11 c 1 + a 12 c 2
c 2 λ = a 21 c 1 + a 22 c 2
or
(a 11 − λ)c 1 + a 12 c 2 = 0
(1.8)
a 21 c 1 + (a 22 − λ)c 2 = 0
Equations 1.8 are the 2x2 case of the linear algebraic eigenvalue problem
(A − λI)c = 0 (1.9)
where
a 11 a 12 ··· a 1n
a 21 a 22 ··· a 2n
A= . .. ..
.. . .
a n1 a n2 · · · a nn
1 0 ··· 0
0 1 ··· 0
I= . .. ..
.. . .
0 0 ··· 1
n = 2 for Equations 1.8, and we use a bold faced symbol for a matrix or a
vector.
The preceding matrices and vectors are
The reader should confirm that the matrices and vectors in Equation 1.9 have
the correct dimensions for all of the indicated operations (e.g., matrix addi-
tions, matrix-vector multiples).
Note that Equation 1.9 is a linear, homogeneous algebraic system (homoge-
neous means that the right-hand side (RHS) is the zero vector). Thus, Equation
1.9, or its 2x2 counterpart, Equations 1.8, will have nontrivial solutions (c =
0)
if and only if (iff) the determinant of the coefficient matrix is zero, i.e.,
|A − λI| = 0 (1.10)
Equation 1.10 is the characteristic equation for Equation 1.9 (note that it is a
scalar equation). The values of λ that satisfy Equation 1.10 are the eigenvalues
of Equation 1.9. For the 2x2 problem of Equations 1.8, Equation 1.10 is
a 11 − λ a 12
=0
a 21 a 22 − λ
or
(a 11 − λ)(a 22 − λ) − a 21 a 12 = 0 (1.11)
λ2 − (a 11 + a 22 )λ + a 11 a 22 − a 21 a 12 = 0
(a 11 + a 22 ) ± (a 11 + a 22 )2 − 4(a 11 a 22 − a 21 a 12 )
λ1 , λ2 = (1.12)
2
Thus, as expected, the 2x2 system of Equations 1.8 has two eigenvalues.
In general, the nxn algebraic system, Equation 1.9, will have n eigenval-
ues, λ1 , λ2 , . . . , λn (which may be real or complex conjugates, distinct or
repeated).
Since Equations 1.6 are linear constant coefficient ODEs, their general so-
lution will be a linear combination of exponential functions, one for each
eigenvalue
y1 = c 11 e λ1 t + c 12 e λ2 t
(1.13)
y2 = c 21 e λ1 t + c 22 e λ2 t
Equations 1.13 have four constants which occur in pairs, one pair for each
eigenvalue. Thus, the pair [c 11 c 21 ]T is the eigenvector for eigenvalue λ1 while
[c 12 c 22 ]T is the eigenvector for eigenvalue λ2 . In general, the nxn system of
Equation 1.9 will have a nx1 eigenvector for each of its n eigenvalues. Note
that the naming convention for any constant in an eigenvector, c i j , is the
ith constant for the jth eigenvalue. We can restate the two eigenvectors for
Equation 1.13 (or Equations 1.8) as
c 11 c 12
, (1.14)
c 21 λ1
c 22 λ2
y10 = c 11 e λ1 0 + c 12 e λ2 0
(1.15)
y20 = c 21 e λ1 0 + c 22 e λ2 0
(a 11 − λ1 )c 11 + a 12 c 21 = 0
or
(−a + (a − b))c 11 + bc 21 = 0
c 11 = c 21
Similarly, for λ = λ2
(a 11 − λ2 )c 12 + a 12 c 22 = 0
or
(−a + (a + b))c 12 + bc 22 = 0
c 12 = −c 22
y10 = c 11 − c 22
y20 = c 11 + c 22
or
y10 + y20
c 11 = = c 21
2
y20 − y10
c 22 = = −c 12
2
dy
= f (y, t) = λy (1.22)
dt
where λ is a constant. Then
f i = λyi
∂f ∂f
f + = λ (λyi )
∂y ∂t i
h2
yi+1 = yi + λyi h + λ (λyi ) = yi (1 + λh + (λh)2 /2!)
2!
yi (1+λh +(λh)2 /2!) is the Taylor series of yi e λh up to and including the h 2 term,
but yi e λh is the analytical solution to Equation 1.22 with the initial condition
y(ti ) = yi for the integration step, h = ti+1 − ti . Thus, as stated previously,
Equation 1.21 fits the Taylor series of the analytical solution to Equation 1.22
up to and including the (d 2 yi /dt 2 )(h 2 /2!) term.
Of course, we could, in principle, continue this process of including ad-
ditional terms in the Taylor series, e.g., using the derivative of the second
Sarah Jane. Well, what adventures have you had to-day, ’Zekiel?
Ezek. The richest was with Mis’ Skinflint. Mis’ Deacon Pettengill told
me she was as mean as dirt (here Mrs. S. starts, but, on second
thoughts, waits to hear what is coming next. Mrs. Hobbs smiles,
grimly), and I thought I see if I couldn’t sarcumvent her.
S. J. What did you do?
Ezek. I offered her a clock for twelve dollars, and she beat me
down to five. I usually sell ’em for a dollar and a half.
S. J. I suppose ’twasn’t worth even that.
Ezek. It doesn’t go much, but when it does, it makes up for lost
time. Then she wanted some spettercles. She took a pair for two
dollars and a half that I generally get seventy-five cents for; but I’ll
warrant they won’t magnify any too much, for there’s nothing but
winder-glass in ’em.
Mrs. S. (emphatically). The villain!
S. J. You was rather too bad, ’Zekiel.
Ezek. Not at all. She bought some calico, and asked if it would
wash. I told her it would wash like white cloth, and I guess ’twill.
After two or three washings, there won’t be a bit of color left in it.
Mrs. S. Oh, the wretch! Won’t I give it to him! (Mrs. Hobbs smiles.
She evidently enjoys the scene.)
Ezek. But the cream of the joke was that she wanted some hooks
and eyes and a spool of thread, and gave me a mince pie for them. I
tasted it, but it was such wretched stuff that I couldn’t eat it, so I
threw it into the river for the fishes.
(Mrs. Skinflint dashes into the kitchen with arms akimbo. Ezekiel
shrinks back with mock terror. Sarah Jane and her mother come
forward, smiling, to see what will be done.)
Mrs. S. What do you mean, you wretch, by cheatin’ me in such a
way?
Ezek. I didn’t cheat you. You tried to keep me from gettin’ any
profit on my goods. I put a price on them, and you could take them
or not, as you pleased. You was willin’ to pay what I asked for them;
so I don’t see how I cheated you.
Mrs. S. You didn’t tell me the truth about ’em (furiously). Then you
called the nice pie I gave you wretched stuff. I shouldn’t ’a thought
of givin’ it to you ef ye hadn’t said you didn’t git anythin’ fit to eat
here.
Mrs. H. (starting forward). What’s that? What did he say?
Mrs. S. (gloating over her discomfiture). He said you wasn’t much
of a cook, and, ef it warn’t for courtin’ Sairy Jane, he couldn’t stand
it boardin’ here.
Mrs. H. (to Ezek.). So that’s the way you repay my kindness in
taking you in, is it, you miserable villain? I’m mad enough to pull
your hair—if you only had enough to pull.
Ezek. (glancing sideways at her). I shouldn’t dare to pull yours,
marm, for fear ’twould come off in my hand.
Mrs. H. (advancing with a threatening air, and catching up the
tongs as she goes). Get out of the house, you insultin’ creature, and
never let me set eyes on you again!
(Ezekiel goes out as if in fear, r., slyly beckoning to Sarah Jane to go
too. She nods and goes out by another door, r. Mrs. Hobbs throws
Ezekiel’s pack after him.)
Mrs. H. (going toward Mrs. S. with tongs upraised). Now, old
Skinflint, do you go too. You’ve made mischief enough here. I don’t
blame the man for throwin’ your miserable pie away. I hope it wont
pizen the fishes.
Mrs. S. (looking back as she goes out, r.). I guess you’ll find
you’ve got enough to look after, without ’tendin’ to your neighbors’
business (pointing). There goes Sairy Jane with that peddler’s arm
round her waist.
(Exit Mrs. Skinflint from one door, r., while Mrs. Hobbs dashes out
from another, r. Curtain falls.)
MRS. GRUNDY’S TYRANNY.
CHARACTERS.
Mr. Charles Goodenow, ⎫
Mr. Edward Henderson, ⎬ Merchants.
Mr. Frank Burley, ⎭
Mrs. Burley, Mr. Burley’s Wife.
Mrs. Stockbridge, ⎫
Mrs. Burley’s Friends.
Mrs. Wheeler, ⎭
James, A Customer.
Bridget Murphy, ⎫
Owners of Fruit Stands.
Kate O’Callahan, ⎭