Document 12886291

advertisement
Trial Problems for Modeling and Simulations.
Rodolfo R. Rosales (MIT, Math., Cambridge, MA 02139).
March, 2005.
Abstract
These notes have a few trial problems, with solutions, for the lectures in conservation laws,
finite differences, and discrete to continuum modeling.
Contents
1
Trial Problems. MIT, March, 2005 — Rosales.
1
2
Problem 1. Finite Differences (statement).
In the finite differences problem set you had to consider several simple difference schemes (for
simple pde’s in one space space and one time dimensions), and ascertain their stability properties
by numerical experimentation. In particular, you should have found out that:
Problem 4.1 For the partial differential equation ut + c ux = 0 — where c is some constant —
the stability properties of the explicit finite difference scheme
�
uk+1
= ukn − c
n
are:
Δt
Δx
��
ukn+1 − unk
�
(1.1)
Stable for c < 0, with stability boundary Δt = Δx/|c|.
Problem 4.2 For the partial differential equation ut + c ux = 0 — where c is some constant —
the stability properties of the explicit finite difference scheme
�
uk+1
n
are:
=
ukn
Δt
− c
Δx
� �
�
k
ukn − un−1
,
(1.2)
Stable for c > 0, with stability boundary Δt = Δx/c.
Problem 4.3 For the partial differential equation ut + c ux = 0 — where c is some constant —
the stability properties of the explicit finite difference scheme
�
uk+1
n
are:
=
unk
Δt
− c
2 Δx
� �
�
k
ukn+1 − un−1
,
(1.3)
Never stable.
Problem 4.4 For the partial differential equation ut = ν uxx — where ν > 0 is some constant —
the stability properties of the explicit finite difference scheme
�
uk+1
n
are:
=
ukn
Δt
− ν
(Δx)2
�
�
ukn+1 − 2 ukn + ukn−1
�
(1.4)
Stable for ν > 0, with stability boundary Δt = (Δx)2 /(2 ν).
As it turns out, the scheme in equation (??) can be stabilized by adding suitable “correction”
terms to it.1 The “corrected” scheme is then:
�
�
�
�
k
k
uk+1
= ukn − α un+1
− un−1
+ 2 α2 ukn+1 − 2 ukn + ukn−1 ,
n
(1.5)
where α = c Δt/(2 Δx), and the correction terms are the ones multiplied by α2 .
1
This is done by first identifying what causes the instability, and then modifying the scheme appropriately to
eliminate it.
Trial Problems. MIT, March, 2005 — Rosales.
3
Now, this is the question for this problem: without doing any numerical experi­
mentation, or any lengthy analysis, can you identify the functional form for the stability boundary for
this last scheme?
The stability boundary for this scheme is pretty simple, and has the usual form Δt = A (Δx)n ,
where A and n are constants. By “functional form” we mean:
a. What is the value of n? Note that it should be independent of the constant c in the equation.
b. How does A depend on the constant c in the equation? That is: Is A proportional to c? Is A inversely
proportional to c? Something else? If so, what, precisely?
c. Extra credit:
As it turns out, the stability properties of this scheme are independent of the sign of c. Why?
Note: you must provide a justification for your answer. No lengthy analysis is
needed. There is a very simple and short argument that provides the answer, but
you must do it.
Hint 1.1 Recall that stability for a scheme means that errors do not grow. Since all the schemes
here are linear, the growth of the errors is independent of the solution itself. Namely: write the
schemes in the generic form:
�
�
uk+1
= Function ukn+1 , ukn , ukn−1 ,
n
(1.6)
where the function on the right is linear. Thus, if we write
ukn = Unk + Enk ,
where U is the “exact” solution, and E is the error, we find:
�
�
k
k
Enk+1 = Function En+1
, Enk , En−1
.
(1.7)
Hence, stability means: if we put ANY initial conditions in the numerical scheme, they will not grow.
Hence stability is an intrinsic property of the scheme itself, and can be a function ONLY of the
parameters in the scheme.
2
Problem 1. Finite Differences (answer).
In each of the examples given there is a single parameter in the scheme, call it α. Thus:
For scheme (??): α = c Δt/Δx.
For scheme (??): α = c Δt/Δx.
For scheme (??): α = c Δt/(2 Δx).
For scheme (??): α = ν Δt/(Δx)2 .
Further, in each case, stability has to do with α being in some range. Thus:
Scheme (??) is stable for: 0 > α > −1.
Scheme (??) is stable for: 0 < α < +1.
Scheme (??) is stable for: no value of α.
Scheme (??) is stable for: 0 < α < +1/2.
Trial Problems. MIT, March, 2005 — Rosales.
4
This, of course, is in perfect agreement with the statements in hint ??. For the scheme (??) the
same sort of thing will be true, with stability in some range for α. Thus, the stability
boundary for scheme (??) must have the form:
Δt = constant Δx/c ,
(2.1)
where we cannot get the numerical value of the constant from this argument. A detailed analysis
yields stability for:
−1 < α < 1 ,
(2.2)
where α = c Δt/(2 Δx).
Extra credit question:
Why should the answer for the scheme in (??) be independent of the sign of c?
Note that the scheme is invariant under the transformation n → −n. Thus, stability should be
invariant too. However, n → −n corresponds to the change x → −x in the equation, which is
equivalent to changing the sign of c.
3
Problem 2. Masses and springs (statement).
As in the notes, consider an array of equal particles (of mass m each) connected by equal springs
obeying Hooke’s law (each with spring constant k). Let the particles be constrained to move along
a straight line, with their positions given by xn = xn (t). Assume now a semi-infinite array of such
particles, extending to the right, with x1 < x2 < x3 < . . . xn < . . .. The equations of motion are
then:
d2 xn
m
= k (xn+1 − 2 xn + xn−1 ) , for n = 2, 3, 4, . . .
(3.1)
dt2
where we still need to provide equations for the first particle. For this purpose, we will now
assume that the first particle is attached (also via one of the springs) to some other particle at
x = x0 (t) < x1 , of mass M — where this last particle is otherwise free to move. Thus we end up
with the two extra equations:
d2 x1
(3.2)
m
= k (x2 − 2 x1 + x0 )
dt2
and
d2 x0
M
= k (x1 − x0 − L) ,
(3.3)
dt2
where L > 0 is the equilibrium length of the springs.
If now the variation in the separation between the masses varies over distances � much larger that
the typical spring length L — i.e. � = L/� � 1 — we can write:
xn (t) = � X(sn , τ ) ,
(3.4)
�
where sn = n �, τ = t/T , T = m/(k �2 ), and X = X(s, τ ) is a smooth function of its argu­
ments. Then, as in the notes, substitute this expression into equation (??-??), expand in Tay­
lor series X(sn±1 , τ ) = X(sn ± �, τ ) = X(sn , τ ) ± � Xs (sn , τ ) + 0.5 �2 Xss (sn , τ ) + . . ., and keep the
Trial Problems. MIT, March, 2005 — Rosales.
5
leading orders. The result is the wave equation
∂ 2X
∂ 2X
=
,
∂τ 2
∂s2
for s > 0 .
(3.5)
This is the equation governing the (small amplitude2 ) longitudinal vibrations of an elastic string
(say, a rubber band).
In order to complete the description, we must specify what happens at the end of the string; i.e.:
we must specify a boundary condition for the pde at s = 0. This will follow from equation
(??), by expanding in a fashion similar to the one leading to (??) starting from (??-??). The
derivation of this boundary condition is the task you must perform.
There are three separate cases to consider:
Case 1. The mass M is of the same size as m. This corresponds to a situation where the end of
the string is free. Show that, in this case, the no stress boundary condition:
Xs (0 , τ ) − 1 = 0
(3.6)
follows.
Case 2. The mass M is much larger than m. In fact, assume M � m/�. This corresponds to a
situation where the mass at the end of the string is so large that the forces the string can apply
hardly affect its motion. Show that, in this case, the boundary condition:
X(0 , τ )τ τ = 0
(3.7)
follows. Thus one first must solve for X(0 , τ ) using this equation, and then the wave equation is
solved requiring that X take these values at the end.
Case 3. The mass M is much larger than m, but not so large that the string forces do not affect it.
In fact, assume µ = � M/m = O(1). This is the most interesting situation, where the mass M and
the string are coupled. Show that, in this case, the boundary condition:
µ X(0 , τ )τ τ = Xs (0 , τ ) − 1
(3.8)
follows.
4
Problem 2. Masses and springs (answer).
Substitute (??) in (??), and expand X(s1 , τ ) = X(� , τ ) in a Taylor expansion around s = 0. This
yields:
M
Xτ τ = k � (Xs − 1 + O(�)) ,
(4.1)
T2
where X and its derivatives are evaluated at (0 , τ ). Now divide by k �, and use the definition of T ,
to obtain:
M�
Xτ τ = Xs − 1 + O(�) .
(4.2)
m
2
So that Hooke’s law applies.
Trial Problems. MIT, March, 2005 — Rosales.
6
Then:
Case 1: the term on the left of this equation is small and can be neglected. Equation (??) follows.
Case 2: the term on the left of this equation is the dominant one. Equation (??) follows.
Case 3: the terms on the right and left of this equation are of the same size. Equation (??) follows.
5
Problem 3. Dimensions (statement).
�
Show that T =
6
m/(k �2 ), as defined in the prior problem, defines a time scale.
Problem 3. Dimensions (answer).
Since � = L/� is the quotient of two lengths, it has no dimensions. On the other hand, k being a
spring constant, has dimensions of force divided by distance. That is to say, k has dimensions of
((mass × length)/(time2 ))/length = mass/(time2 ). Hence T is a time.
7
Problem 4. Rivers and conservation (statement).
In the lectures we argued that:
A. Volume is conserved for the water flowing down a river.
B. The “density” of volume (volume per unit length, in this case) is just the filled cross-sectional
area of the river A = A(x, t), where x is the length coordinate along the river.
Hence, if Q = Q(x, t) is the volume flow along the river, the following equation follows:
∂A ∂Q
+
= 0.
∂t
∂x
(7.1)
In order to “close” the system, we then argued that for rivers in plains — and when the water level
is not changing too rapidly — the flow speed down the river is basically a function of how much
water the river carries. That is: u = u(A). Hence Q = u A is also a function of A. Once a form
Q = Q(A) is plugged into (??) above, the system is closed, as we end up with one equation for the
single un-known A.
What should we take for the function Q = Q(A)? For real rivers this must be measured. However,
here we will give a simple argument for what Q = Q(A) should look like — which is not too bad
for man-made, very regular, channels. The argument goes as follows:
A. The flow velocity u, when the flow is steady, must result from the balance of the force of gravity
down the river slope, with the frictional forces along the bottom.
B. The force of gravity (downstream) on any section dx of the river is proportional to the total
mass in the cross-section ρ A dx times the component of the acceleration of gravity along the river:
g sin θ — where ρ is the density of water and θ the slope of the river bed.
C. The frictional forces per unit length can be obtained from the (empirical) law Ff = Cf u P dx,
where P is the contact perimeter of the water, and Cf is the friction coefficient.
Trial Problems. MIT, March, 2005 — Rosales.
7
What you are asked now to do is to complete the argument: Assuming that
the river bed has some fixed given shape, postulate a (generic) relationship3 giving the contact
perimeter P as a function of A. Balance then the two forces to obtain a relationship giving the flow
velocity u in terms of A. From this obtain a formula for Q = Q(A) — what you should obtain is
that Q = α A1.5 , where α is some constant.
IMPORTANT: Give a real and complete argument. Do not simply “back-engineer” the given
answer using an incomplete or shaky argument.
8
Problem 4. Rivers and conservation (answer).
It should be clear that the contact perimeter, in general,√behaves (approximately) like the square
root of the cross-sectional area. Thus we write P ≈ Cg A, where Cg is a form factor. The two
forces acting on the water are then:
Fg = ρ g sin√
θ A dx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . gravitational force per unit length.
Ff = Cf Cg A u dx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . friction force per unit length.
√
Then Fg = Ff yields u = α A, where α = ρ g sin θ/(Cf Cg ) — hence Q = u A = α A1.5 .
THE END.
3
Think of the special example when the river bed has a triangular cross-section. In this case the relationship is
exact. For other cases it will only be roughly true.
Download