18.311 — MIT (Spring 2015) Answers to Problem Set # 6. Contents

advertisement
18.311 — MIT (Spring 2015)
Rodolfo R. Rosales (MIT, Math. Dept., E17-410, Cambridge, MA 02139).
April 20, 2015.
Answers to Problem Set # 6.
Contents
1 Preventive driving and dissipation.
1.1 Statement: Preventive driving and dissipation. . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Answer: Preventive driving and dissipation. . . . . . . . . . . . . . . . . . . . . . . . . . .
2
2
3
2 Eikonal equation
2.1 Introduction: Eikonal equation . . . . . . . . . .
2.2 Statement: Eikonal equation (part 1) . . . . . .
Derive the Eikonal equation . . . . . . . . .
2.3 Statement: Eikonal equation (part 2) . . . . . .
Characteristics and envelope . . . . . . . . .
2.3.1 Some hints and notation . . . . . . . . . .
2.3.2 Recap: what is the envelope of a family of
2.4 Answer: Eikonal equation (part 1) . . . . . . . .
2.5 Answer: Eikonal equation (part 2) . . . . . . . .
4
4
6
6
6
6
6
7
7
8
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
curves?
. . . . .
. . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3 Introduction. Isentropic Gas Dynamics
9
4 Ideal gases thermodynamics.
11
4.1 Statement: Ideal gases thermodynamics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Answer: Ideal gases thermodynamics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Problem GaDy01. Riemann Invariants in Isentropic Gas Dynamics.
13
5.1 GaDy01 statement. Riemann Invariants in Isentropic Gas Dynamics . . . . . . . . . . . . . 13
5.2 GaDy01 answer. Riemann Invariants in Isentropic Gas Dynamics . . . . . . . . . . . . . . . 14
6 Computer Exercise in Fourier Series
6.1 Introduction to Computer Exercise in Fourier Series . . . . . . . . . . . .
6.2 Statement: Computer Exercise in Fourier Series . . . . . . . . . . . . . .
Study the convergence properties of the Fourier series. In particular, the
effect of any singularities (i.e.: lack of smoothness) in the function .
6.3 Answer: Computer Exercise in Fourier Series . . . . . . . . . . . . . . . .
15
. . . . . . . . . . 15
. . . . . . . . . . 16
. . . . . . . . . .
. . . . . . . . . .
16
17
List of Figures
1.1
2.1
2.2
6.1
Preventive driving and dissipation. . . . . . . . . . . . . . . . . . .
Wave-front folding for the Eikonal Equation . . . . . . . . . . . . .
Envelope of rays for the Eikonal Equation . . . . . . . . . . . . . .
Computer Exercise in Fourier Series: Gibbs phenomenon in a sawtooth
1
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
function . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4
8
9
19
18.311 MIT, (Rosales)
6.2
1
Preventive driving and dissipation.
Computer Exercise in Fourier Series: Gibbs phenomenon. Detail
. . . . . . . . . . . . . . . .
2
20
Preventive driving and dissipation.
1.1
Statement: Preventive driving and dissipation.
The simplest way to incorporate “preventive driving” into a mathematical model for traffic flow, is to
modify the quasi-equilibrium assumption, q = Q(ρ), in the equation for the conservation of cars
ρt + qx = 0.
(1.1)
This by adding a dependence on the density gradient, as follows
q = Q(ρ) − ν ρx ,
(1.2)
where ν > 0 is some “small” constant.1 The governing equation then becomes
ρt + c(ρ) ρx = ν ρx x ,
(1.3)
dQ
— note that only solutions satisfying 0 ≤ ρ ≤ ρj are acceptable. As usual, we assume
dρ
that q = Q(ρ) is a concave function, vanishing at both ρ = 0 and the jamming density ρj > 0, positive
for 0 < ρ < ρj , with a maximum (the road capacity qm ) at some value 0 < ρm < ρj — recall that concave
d2 Q
means that
< 0.
dρ2
where c =
The term on the right hand side in (1.3) introduces “dissipation”. In particular, consider a solution such
that ρ and its derivatives vanish 2 as x → ±∞. Then it can be shown that
Z ∞
Z ∞
1 2
d
ρ dx = −ν
ρ2x dx < 0.
(1.4)
dt −∞ 2
−∞
Thus this term drives the solution towards the constant state ρ = 0 — a similar calculation shows that a
periodic (inZspace) solution is also driven towards a constant: the mean value of ρ. Surprisingly, as ν → 0,
∞
the term ν
−∞
ρ2x dx need not vanish — as you will be asked to show below.
Your tasks in this problem are:
Z ∞
1. Calculate A = ν
ρ2x dx for a shock solution (see remark 1.1), and show that it is independent of
−∞
ν. In fact: interpret A as the area between two curves.
Hint: Change variables in the integrand, from x to ρ — you can do this because, for shock solutions,
ρ is an increasing function of x. Use also the ode satisfied by the shock solutions, as displayed in
remark 1.1.
2. Derive (1.7) below, in remark 1.1. Hint: dR/dχ vanishes as χ → ±∞.
1
2
Here “small” means that, for some “typical” time, τ , and length, `, scales: τ ν/`2 1.
This is needed so that the integrals in (1.4) make sense.
18.311 MIT, (Rosales)
Preventive driving and dissipation.
3
3. Derive (1.4). Hint: multiply (1.3) by ρ and integrate. This gives an equation with three terms. One
of them is the term on the left in (1.4). The term with the integrand ρ c(ρ) ρx has zero contribution
— why? For the remaining term, use integration by parts. Note: assume that the solution is smooth
enough, and vanishes at infinity fast enough, to justify operations such as exchanging the order of
integration and differentiation.
Remark 1.1 In the context of (1.3), shocks are interpreted as traveling wave solutions
ρ = R(χ),
x − st
,
ν
χ=
(1.5)
which (exponentially) approach limits ρL = lim R(χ) and ρR = lim R(χ) — here s is the shock speed.
χ→∞
χ→−∞
Substitution of (1.5) into (1.3) yields
dR
= Q(R) − s R − κ,
dχ
(1.6)
where κ is a constant. In fact, with qL = Q(ρL ) and qR = Q(ρR ), it must be that
qR − qL
ρR − ρL
s=
and
κ=
qL ρR − qR ρL
.
ρR − ρL
(1.7)
Then y = s ρ + κ, for ρL < ρ < ρR , is the secant line joining (ρL , qL ) to (ρR , qR ). Thus, because of the
concavity of Q, the right hand side in (1.6) is positive for ρL < ρ < ρR , from which it follows that
ρL < ρR .
(1.8)
Hence these traveling waves satisfy both the Rankine-Hugoniot and the entropy conditions. Note also that,
as ν → 0, these solutions become a piece-wise constant solution, jumping at x = s t + x0 from the value ρL
on the left, to the value ρR on the right (x0 ) is some constant.
1.2
Answer: Preventive driving and dissipation.
1. We have
Z
A = ν
Z
=
∞
−∞
ρ2x dx
Z
∞
=
−∞
Rχ2 dχ
Z
ρR
=
Rχ dR =
ρL
ρR
(Q(R) − s R − κ) dR.
(1.9)
ρL
Thus A is the area between q = Q(ρ) and the secant line joining (ρL , qL ) to (ρR , qR ), as shown in
figure 1.1.
2. Because dR/dχ vanishes as χ → ±∞, (1.6) yields 0 = qR − s ρR − κ = qL − s ρL − κ. Hence qR − s ρR = qL − s ρL
from which the formula for s in (1.7) follows. The formula for κ can then be obtained from either
κ = qR − s ρR , or κ = qL − s ρL .
3. Multiply (1.3) by ρ and integrate. This gives
Z ∞
Z ∞
Z
ρ ρt dx +
ρ c(ρ) ρx dx = ν
−∞
−∞
∞
−∞
ρ ρx x dx.
(1.10)
18.311 MIT, (Rosales)
Eikonal equation
4
However
Z ∞
Z ∞
d
1 2
— Exchanging integration and derivation gives
ρ ρt dx.
ρ dx =
dt −∞ 2
−∞
Z ρ
Z
— Let f =
s c(s) ds. Then ρ c(ρ) ρx = fx , and f → 0 as x → ±∞. Hence
ρ c(ρ) ρx dx = 0.
−∞
0
— Using ρ ρx x = (ρ ρx )x − ρ2x , it we obtain that
∞
Z
∞
Z
∞
ρ ρx x dx = −
−∞
ρ2x dx.
−∞
Thus (1.10) reduces to (1.4).
q = Q(!) (red), and secant line (blue).
Figure 1.1: The picture on the right illustrates
the area A, determined by the (concave) traffic
flow function q = Q(ρ) and the secant line joining
(ρL , qL = Q(ρL )) to (ρR , qR = Q(ρR )), which is
given by the formula y = s ρ + κ — as follows from
remark 1.1.
A
q
!L
0
2
2.1
!R
!
Eikonal equation
Introduction: Eikonal equation
Consider situations like the ones described in the examples below
A. Imagine a wave-front of some sort, propagating into a medium. For example, a combustion front,
across which some chemical reactions in a solid combustible media are taking place. Then the fresh
(unburnt) media is ahead of the front, and the burnt media is behind it.
If the chemical reactions happen fast enough, it is reasonable to approximate the burning region as
infinitely thin, and model the front by a surface moving in space. This surface, and its evolution in
time, can then be described by a function Φ = Φ(r) such that the level surface
Φ(r) = t
(2.1)
is the wave-front at time t. Notation: here r is the position vector in space. Thus, in 2-D r = (x, y),
and in 3-D r = (x, y, z).
Of course, in order for this description to be useful, we need some equation for Φ, so that (for
example) given that we know the position of the wave-front at some time t0 (that is, we know the
level surface Φ(r) = t0 ), we can predict it for future times. We do this next.
If the media is isotropic, it is reasonable to assume that, at each point in space, the wave-front
propagates normal to itself at some known velocity c = c(r) > 0, which we can either get by direct
18.311 MIT, (Rosales)
Eikonal equation
5
measurement or (in principle, at least) from an analysis of the detailed physics at the burning front.
With this assumption, it can be shown that the phase function satisfies the
Eikonal equation: (c ∇Φ)2 = 1.
(2.2)
Note: We have assumed here the simplest of situations, where the speed of propagation depends
only on the properties of the unburnt media ahead of the front (so that c = c(r)). More complicated
situations can arise, where the speed of propagation depends also on other factors (such as the local
curvature of the front), or other variables (such as the local temperature) for which extra equations
are needed.
B. Another circumstance under which the Eikonal equation (2.2) arises is the one where high frequency
waves (say, light or sound) propagate into some media. The idea is as follows: suppose that the
governing equation is the wave equation
utt = div(c2 ∇u) ,
where
c = c(r) > 0.
(2.3)
Consider now a stationary wave situation, where the field u is vibrating everywhere with the same
frequency, and all the wave-fronts move along the same path (think of the light coming from some
source, which does not change in time, nor moves, and is illuminating a region of space where nothing
moves or changes either). If the wave-length is short enough, then near each point in space (and time)
the wave-fronts will be nearly plane and will move normal to themselves at speed c. In this case, if
we (again) introduce a phase function Φ to describe the wave-fronts, equation (2.2) will apply.
Notice that in this second situation there is not a single wave-front, but many (the light source emits
as many wave-fronts per unit of time as its frequency). However, all the wave-fronts behave in the
same way, taking the same sequence of positions in time (with only a time delay differentiating one
wave-front from the other). That is, the wave-fronts are given by the equation
Φ(r) = t + ζ ,
(2.4)
where ζ is the time delay.
Remark 2.1 The situation described in B above is the mathematical formulation of the idea that light
(or high frequency sound waves) propagates along rays (which are straight on an homogeneous media, and
curved otherwise). The Eikonal equation can be written in terms of characteristics (see Part II below),
with the characteristics giving the rays along which light propagates.
Furthermore, it can be shown (though we will not do this here) that the energy is carried along characteristics. Thus, when the rays diverge, the energy density (light intensity) in the waves goes down. Similarly,
the light intensity goes up when the rays converge. In particular, when the rays cross, an infinite energy
density is predicted. Of course, we cannot take this at face value (since when rays cross, the wave-fronts
develop infinite curvature, and the approximations made in deriving the Eikonal equation break down).
Nevertheless, it is still true that the energy density becomes large at the locations where the rays cross.
The envelope of the rays (see Part II below) for the Eikonal equation is thus very important, since it gives
the location in space where we should expect to find large wave amplitudes. It is very easy to locate these
places when dealing with light, since they correspond to very bright curves and surfaces in space; known as
caustics. You can easily see caustics if you put a glass filled with water, on a white surface, under a bright
light.
18.311 MIT, (Rosales)
2.2
Eikonal equation
6
Statement: Eikonal equation (part 1)
Derive the Eikonal equation (2.2) to describe the situation where a moving surface, given by Φ(r) = t,
moves at speed c = c(r) (normal to itself) at each point in space.
Hint 2.1 Consider the wave-front at time t, and let n̂ be the unit normal to the wave-front at any place
along it (pointing into the direction of propagation.3 ) Then because the wave-front propagates normal to
itself at velocity c, it should be that:
r is in the wave-front at time t if and only if r + n̂ c dt is in the wave-front at time t + dt.
In other words
Φ(r) = t
2.3
⇐⇒
Φ(r + n̂ c dt) = t + dt.
(2.5)
Statement: Eikonal equation (part 2)
Consider the case of an homogeneous two dimensional media, where the speed of propagation c is a constant.
In this case we can choose non-dimensional variables so that c ≡ 1 and the Eikonal equation reduces to
(∇Φ)2 = 1,
(2.6)
where Φ = Φ(x, y) and the wave-fronts are the curves Φ(x, y) = constant. This last equation has a characteristic form, given by:
dr
=k
dt
and
dk
= 0,
dt
along which
dΦ
= 1.
dt
(2.7)
Here r = (x, y) is the position vector in space and k = ∇Φ is the wave-number vector, which is normal to
the wave-fronts and (from (2.6)) also a unit vector. A solution of the Eikonal equation is determined once
we give a wave-front, which can then be used to provide initial values for these characteristic equations.
The curves in space r = r(t) — given by the solution of
JARGON:
the characteristic equations (2.7) — are are called rays.
Consider now the situation where the wave-front Φ = 0 is the parabola y = x2 . Then
(a) Compute the characteristics for this situation.
(b) Consider the family of curves in space given by the rays just computed as part of doing item (a).
Find the envelope of this family and express it in the form y = y(x).
(c) Plot the envelope computed in part (b).
Note that this problem has relatively simple algebra and you should not have big hassles with it, provided
you are careful, organized, and keep your notation straight.
2.3.1
Some hints and notation
The initial wave-front Φ = 0 can be described by the parametric equations x = s and y = s2 , where
−∞ < s < ∞ is the parameter. The unit tangent and unit normals to this curve are
1
2s
−2s
1
√
√
√
√
t̂ =
,
and n̂ =
,
.
(2.8)
1 + 4s2
1 + 4s2
1 + 4s2
1 + 4s2
3
You can easily get n̂ from ∇Φ.
18.311 MIT, (Rosales)
Eikonal equation
7
Then for each s we have a characteristic, where the formula for n̂ defines the initial value for k.
After you solve the characteristic equations, you will end up with formulas for the rays of the form
x = x(s, t) and y = y(s, t), where each s defines and individual ray. The rays are given parametrically,
with t the parameter along each ray. You should find it rather easy to eliminate the parameter t from the
formula for the rays, so that you can write the ray labeled by s as the solution to an equation of the form
F (x, y, s) = 0.
(2.9)
Once you do this, you’ll have the standard form used to compute envelopes. From this, getting the envelope
in the form x = x(s) and y = y(s) is rather straightforward. Eliminating s from these two last expressions
should now be easy, and it will give you the requested form y = y(x) for the envelope. This will end up
being a rather simple formula, that you can plot without trouble.
2.3.2
Recap: what is the envelope of a family of curves?
The envelope of a family of curves can be defined for families of curves that depend smoothly on a parameter:
a smooth curve for each parameter value, and the curves depend smoothly on the parameter. Specifically:
The envelope of a family of curves is the locus of the points where two “infinitesimally close” members of
the family intersect. Alternatively, it can also be defined as a curve Ce such that: (i) Every point in Ce ,
say p, belongs also to a member curve of the family, say Fp . (ii) Ce and Fp are tangent at p.
As an example, consider the family of curves given by an equation like (2.9). Let us apply the first
definition: a point p = (x, y) belongs to the envelope if, for some s, it satisfies both
F (x, y, s) = 0
and
F (x, y, s + ds) = 0.
But F (x, y, s + ds) = F (x, y, s) + Fs (x, y, s) ds. Thus the envelope curve follows from the two equations
F (x, y, s) = 0
and
Fs (x, y, s) = 0,
(2.10)
Let us apply now the second definition: It says that we can write
the envelope in the form x = X(s) and y = Y (s), where
F (X, Y , s) = 0, [A]
and (Ẋ, Ẏ ) is orthogonal to the curve F (x, y, s) = 0 at (X, Y )
— that is:
Ẋ Fx (X, Y , s) + Ẏ Fy (X, Y , s) = 0. [B]
However, [A] implies
Ẋ Fx (X, Y , s) + Ẏ Fy (X, Y , s) + Fs (X, Y , s) = 0. [C]
Thus [B] is equivalent to
Fs (X, Y , s) = 0. [D]
Note now that [A] and [D] are the same as (2.10). The two definitions give the same answer.
In the contexts where the Eikonal equation applies, the envelope of the rays (caustic) corresponds to the
places where portions of the initial wave-front are squeezed into a point, so that the energy density goes
to infinity. This, of course, does not quite happen in the physics (eikonal approximation fails at caustics),
but high energy densities occur there.4
2.4
Answer: Eikonal equation (part 1)
Following hint 2.1, we notice that the unit normal to the wave-fronts is given by
n̂ =
1
∇Φ,
|∇Φ|
(2.11)
4
In fact, it can be shown that the wave amplitude ratio (at caustic versus initial) is proportional to the inverse sixth power of
the wave-length — i.e.: r ∝ λ−1/6 . The shorter the wave-length, the bigger the magnification.
18.311 MIT, (Rosales)
Eikonal equation
8
since the gradient is always normal to the level surfaces. Furthermore, this normal points in the direction
of propagation, since Φ increases in the direction of propagation — as follows from equation (2.1), which
implies that the value of Φ along a wave-front increases as the front moves.
We now expand the second equation in (2.5) up to O(dt), and use the first equation to eliminate the leading
order. This yields, upon dividing by dt,
(n̂ · ∇Φ) c = 1
c |∇Φ| = 1,
=⇒
(2.12)
where we have used that ∇Φ = |∇Φ| n̂ (as follows from (2.11)) to get the second equality. The second
equation here is clearly equivalent to the Eikonal equation (2.2), since c > 0.
2.5
Answer: Eikonal equation (part 2)
Consider the Eikonal equation for a 2-D media with constant wave speed c = 1. Namely
(∇Φ)2 = 1,
where
Φ = Φ(x, y),
(2.13)
and the wave-fronts are given by Φ(x, y) = t = constant. The characteristic equations for (2.13) are
dr
dk
= k and
= 0,
dt
dt
along which
dΦ
= 1,
dt
(2.14)
where t = time, r = (x, y) is the position vector in space and k = ∇Φ is the wave-number vector. Note
that k is normal to the wave-fronts and (from (2.13)) it is also a unit vector.
Wave front folding.
0.4
t = 0.5
Caustic
0.2
x
t = 0.9
t=0
0
-0.2
-0.4
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
y
Figure 2.1: Eikonal equation problem. This figure shows (i) the wave-front (as described by the Eikonal
equation (2.13)) for three times, (ii) the envelope of the rays (caustic) and (iii) a few rays. The time t = 0.5
is precisely the one for which the wave-front is about to start folding (first crossing of rays).
Let the initial wave-front Φ = 0 be the parabola y = x2 , parametrized by x = s and y = s2 , where
−∞ < s < ∞. The initial conditions for the characteristic equations are then:
−2s
1
2
r = (s, s ), k = √
, √
and Φ = 0 for each − ∞ < s < ∞.
(2.15)
1 + 4s2
1 + 4s2
18.311 MIT, (Rosales)
Isentropic Gas Dynamics. Introduction.
9
The solution to the characteristic equations (2.14) is then Φ = t, k ≡ constant and
−2s
1
2
r = (x, y) = (s, s ) + √
, √
t.
(2.16)
1 + 4s2
1 + 4s2
p
From the expression here for y along each ray, it is clear that t = (y − s2 ) 1 + 4s2 . Using this to eliminate
t in the expression for x in (2.16), we obtain the following equation for the rays
F = F (x, y, s) = x + 2sy − s − 2s3 = 0.
(2.17)
∂F
∂F
The envelope for the family of curves (rays) given by (2.17) follows from F =
= 0. The equation
=0
∂s
∂s
1
yields y = 3s2 + , which can be used in (2.17) to eliminate y and obtain the envelope in parametric form:
2
x = −4s3 and y = 3s2 +
Clearly the envelope has a cusp at r = (0,
1
2
=⇒
y=
1
3
+√
x2/3 .
3
2
16
(2.18)
1
) — see figures 2.1 and 2.2.
2
Envelope of rays.
2.5
2
1.5
y
The envelope is given by
equation (2.18).
1
0.5
0
-2
-1
0
x
1
2
Figure 2.2: Envelope of the rays for the Eikonal equation (2.13), for a parabolic initial wave-front.
3
Introduction. Isentropic Gas Dynamics
This section contains materiel needed for some of the problems that involve Gas Dynamics.
Equations that govern the behavior of a gas can be derived using the same Conservation Equation techniques used to derive equations for the examples of Traffic Flow, River Flows, Shallow Water Waves,
Modulations of Dispersive Waves, etc. The conserved quantities in this case are the mass, the momentum
and the energy. The resulting equations are the Euler equations of Gas Dynamics.
18.311 MIT, (Rosales)
Isentropic Gas Dynamics. Introduction.
10
Under certain conditions, one can assume that the entropy is a constant throughout the flow. Then the
equations can be simplified, with the elimination of the equation for the conservation of energy. The one
dimensional isentropic (constant entropy) Euler equations of Gas Dynamics are
ρt + (ρ u)x = 0,
(3.19)
(ρ u)t + (ρ u2 + p)x = 0,
where ρ = ρ(x, t), u = u(x, t), and p = p(x, t) are the gas mass density, flow velocity, and pressure, respectively. The first equation here implements the conservation of mass, and the second the conservation
of momentum. We also need some equations relating the fluxes of the conserved quantities with the conserved densities — the analogue of the equation q = Q(ρ) in Traffic Flow. In this case this is provided by
an equation of state, relating the pressure to the density. This takes the form
dP
p = P (ρ), where P is a function satisfying
> 0.
(3.20)
dρ
For example, for an ideal gas P = κργ , where κ > 0 and 1 < γ < 2 are constants.
The system of equations given by (3.19) is known as the
Conservation Form of the Isentropic Equations
of Gas Dynamics, in Eulerian Coordinates.
Remark 3.2 Normally, the pressure is a function of both the density and some other thermodynamic
variable, such as the temperature. But the isentropic assumption allows us to write the pressure as a
function of the gas mass density only.
Introduce now the function c = c(x, t) > 0 (c is the sound speed) by5
s
dP
c = C(ρ), where C(ρ) =
(ρ).
dρ
(3.21)
An alternative form of the equations in (3.19) is then given by

ρt + u ρx + ρ ux = 0, 
c2
ut + ρx + u ux = 0. 
ρ
(3.22)
As mentioned earlier, in the form given by (3.19), the equations are said to be written in Eulerian (or
laboratory) Coordinates. The equations can also be written in Lagrangian Coordinates, where the “space”
coordinate is a label for each mass particle, rather than a position in space.
To transform the equations in (3.19) to Lagrangian coordinates, introduce the variable
Z x
σ = σ(x, t) =
ρ(ζ, t)dζ,
(3.23)
xp
dxp
= u(xp , t). If there
dt
is a finite amount of gas, we can take xp = −∞. If there is an impermeable wall somewhere (beginning or
where xp = xp (t) is the position of some arbitrary (but fixed) fluid particle — i.e.:
p
For an ideal gas, c = γ p/ρ. For dry air at one atmosphere and 15 degrees Celsius: p = 1.013 × 106 dyn/cm2 ,
−3
3
ρ = 1.226 × 10 g/cm , and γ = 1.401. Hence c = 340.2 m/s — measured value is c = 340.6 m/s.
5
18.311 MIT, (Rosales)
Ideal gases thermodynamics.
11
end of a pipe containing the gas), we can use as xp the position of the wall. Then σ denotes “the mass to
the left of a given point in space x”, so that σ is constant if and only if x changes to track a fixed mass
point in the gas. That is: σ is a Lagrangian Coordinate. In fact σ is defined so that:
∂σ
= ρ,
∂x
and
∂σ
= −ρ u.
∂t
(3.24)
Then, if a change of independent variables (from (x, t) to (σ, t)) is made, you can check that the equations
take the form:
vt − uσ = 0,
(3.25)
ut + pσ = 0,
where v = 1/ρ is the specific volume, and p = p(v) — note that
dp
= −ρ2 c2 ,
dv
where c is the sound
speed (defined in (3.21)). For an ideal gas p = κ v−γ .
The system of equations given by (3.25) is known as the
Conservation Form of the Isentropic Equations
of Gas Dynamics, in Lagrangian Coordinates.
4
Ideal gases thermodynamics.
4.1
Statement: Ideal gases thermodynamics.
Consider a gas in a container, at equilibrium. The gas can then be described in terms of the thermodynamic
variables: ρ (density), v = 1/ρ (specific volume), p (pressure), T (absolute temperature), e (internal
energy per unit mass), S (entropy), etc. These quantities are not independent, in fact: given any two of
them, the others follow via equations of state. In particular, e is a function of T
e = e(T )
(4.1)
T dS = de + p dv.
(4.2)
and
Note that the second law of thermodynamics states that dS ≥ 0 for any allowed physical process.6
In particular, for an ideal gas
p v = Rs T ,
(4.3)
where Rs > 0 is the specific gas constant. A polytropic gas is an ideal gas such that
e = cv T ,
(4.4)
where cv > 0 is a constant — the specific heat at constant volume. In addition, we introduce
cp = Rs + cv
6
and γ =
cp
,
cv
(4.5)
Equation (4.2) indicates that the temperature is an integrating factor for any “work” done on the system δw = de + p dv. This
P
generalizes to more complicated systems. For example, in the presence of chemical reactions: T dS = de + p dv − n µn dCn ,
where the Cn are the concentrations and the µn are the chemical potentials.
18.311 MIT, (Rosales)
Ideal gases thermodynamics.
12
where cp is the specific heat at constant pressure and γ is the ratio of specific heats — which generally
satisfies 1 < γ < 2. Note that h = e + p v (the enthalpy) satisfies 7
T dS = dh − v dp
and h = cp T .
(4.6)
These are the tasks for this problem: Assume a polytropic gas, and
1. Write the internal energy in terms of the pressure and the specific volume:
e = e(p, v).
2. Write the entropy in terms of the pressure and the specific volume:
S = S(p, v).
Equation (4.2) determines S up to a constant. Let S0 be the value of the
entropy for p = p0 and v = v0 . This determines the constant. Warning:
your answer should not involve things like the logarithm of a volume —
only the log of a number makes sense!
3. Write the pressure in terms of the entropy and the specific volume:
p = p(S, v).
4. Write the internal energy in terms of the entropy and the specific volume:
e = e(S, v).
5. Write the temperature in terms of the entropy and the specific volume:
T = T (S, v).
4.2
Answer: Ideal gases thermodynamics.
We have
1. From (4.3 – 4.4),
e = cv T =
cv
Rs
pv =
pv
γ−1
.
(4.7)
2. Plug into (4.2) e = p v/(γ − 1), T = p v/Rs , and Rs = (γ − 1) cv . This yields
1
dv dp
dS = γ
+ .
cv
v
p
v
p
S = cv γ ln
+ cv ln
+ S0 .
v0
p0
γ
S − S0
v0
p = p0
exp
.
v
cv
γ−1
v0
S − S0
p0 v 0
e=
exp
.
γ−1
v
cv
p0 v0 v0 γ−1
S − S0
exp
T =
.
Rs
v
cv
Integrating this we obtain:
3. Using (4.8) we can write
4. From (4.7) and (4.9) we get
5. From (4.4) and (4.10) we get
p = κ ργ ,
In particular, notice that if S = constant (adiabatic changes)
where κ > 0 is a constant.
7
The names for cv and cp follow because
δw
δT
= cv if v is kept constant, while
δw
δT
= cp if p is kept constant.
(4.8)
(4.9)
(4.10)
(4.11)
(4.12)
18.311 MIT, (Rosales)
5
Isentropic Gas Dynamics. Problem GaDy01.
13
Problem GaDy01.
Riemann Invariants in Isentropic Gas Dynamics.
5.1
Statement for problem GaDy01.
Riemann Invariants in Isentropic Gas Dynamics.
PART I. Derive the system of equations in (3.22) from the system in (3.19).
Z
dB
C(ρ)
PART II. Let B = B(ρ) be given by
=
.
dρ
ρ
s = s(x, t) = u − B(ρ)
ρ
Equivalently B(ρ) =
C(z)
and r = r(x, t) = u + B(ρ).
Show that there exist some functions R = R(ρ, u)
and S = S(ρ, u)
dz
.
z
Then define
(5.1)
such that the Euler equations
(3.22) can be written in the following characteristic form:
• Along the curves
• Along the curves
dx
= R,
dt
dx
= S,
dt
we have
we have
dr
= 0.
dt
ds
= 0.
dt
(5.2)
(5.3)
You are requested to find EXPLICIT formulas for R and S .
Hint 5.1 Note that, since along
similar expression holds for S.
dx
dr
rt
= R we have
= rt + R rx , it follows that it must be R = − . A
dt
dt
rx
WARNING: Both R and S must be functions of ρ and u only — no derivatives involved. But here we
st
rt
and S = − . This means that (if you compute rt , rx , etc., using the
rx
sx
equations, and substitute the answer into these quotients) the derivatives should cancel out! Do not give
an answer for R and S where there are derivatives left; R and S are functions of ρ and u only!
see that it should also be R = −
Remark 5.1 Read this remark AFTER you have done the problem. The points made here are not necessary
for the solution, and may even confuse you if you read them before you solve the problem.
dx
dx
1. The curves defined by the equations
= R and
= S are the characteristics for the Euler
dt
dt
equations (3.19). Notice that we have two sets of characteristic curves, with two different characteristic speeds: R and S. This should be compared with the Traffic Flow or the River Flow examples,
where there is a single set of characteristics with a single characteristic speed. The system (3.19)
can support two types of waves. This is very similar to the situation that occurs for the (linear)
string equation, except that here the waves are nonlinear, and interact with each other.
2. The quantities r and s are known by the name of Riemann Invariants, in honor of Riemann, who
first introduced them. Notice that these quantities are constants (invariant) along their corresponding
characteristics.
3. The Euler equations (3.19) model the dynamics of gas motion in one dimension, under certain assumptions. The physical interpretation of the variables was given earlier and it is as follows: ρ is
the gas mass density, u is the gas flow velocity, p is the gas pressure and c is the sound speed. The
equations implement the conservation of mass and momentum. The two types of waves the model
18.311 MIT, (Rosales)
Isentropic Gas Dynamics. Problem GaDy01.
14
supports are the sound waves moving to the right and to the left. The sound waves move at speed c,
relative to the gas (which moves at speed u). Look at the expressions for R and S you just obtained;
which one corresponds to the right (left) moving wave?.
4. The assumptions made to obtain (3.19) as a model for Gas Dynamics are: neglect viscosity and thermal conductivity, and assume constant entropy. Then the first equation follows from the conservation
of mass, and the second from the conservation of linear momentum.
5. For an ideal gas with constant specific heats (polytropic gas) one has P = κ ργ , where κ > 0 and
1 < γ < 2 are constants — γ is the ratio of the specific heats.
6. If one sets p = ρ2 in (3.19), then the equations are equivalent to the equations for Shallow Water
Waves.
5.2
Answer for problem GaDy01.
Riemann Invariants in Isentropic Gas Dynamics.
PART I. The first equation in (3.22) is clearly the same as the first equation in (3.19). On the other hand,
the second equation in (3.19) can be written in the form
0 = (ρt + (ρ u)x ) u + ρ ut + ρ u ux + px = ρ (ut + u ux ) + px ,
(5.4)
where we have used the first equation in (3.19) to get the last equality. Furthermore, we have px = c2 ρx
— from the definition of c in (3.21) and the chain rule. Thus, upon division by ρ, (5.4) above yields the
second equation in (3.22). We conclude that (3.19) and (3.22) are equivalent forms for the one dimensional
Euler equations of isentropic Gas Dynamics. This concludes the answer to part I.
PART II. From (5.1), the definition of B, and the chain rule, we have rx = ux +
1
1
c ρx and rt = ut + c ρt .
ρ
ρ
Thus, using (3.22):
c2
c
ρx + u ux − (u ρx + ρ ux )
ρ
ρ
c
= −(u + c) (ux + ρx )
ρ
= −(u + c) rx .
rt = −
Similarly, one can show that: st = −(u − c) sx . Thus we can write the Euler equations in the characteristic
form:
• Along the curves
• Along the curves
dx
= R = u + c,
dt
dx
= S = u − c,
dt
we have
we have
dr
= 0.
dt
ds
= 0.
dt
(5.5)
(5.6)
This concludes the answer to part II.
Notice that the characteristics given by R move at a velocity c relative to the flow velocity u — these are
the right moving acoustic waves. Similarly, the characteristics given by S move at a velocity −c relative
to the flow velocity u — these are the left moving acoustic waves.
MIT, (Rosales)
6
6.1
Computer Exercise in Fourier Series.
15
Computer Exercise in Fourier Series
Introduction to Computer Exercise in Fourier Series
Generally, a 2 π-periodic function F = F (x) can be expressed in terms of its Fourier Series:
F (x) =
∞
X
Fn ei n x ,
(6.1)
n=−∞
where the nth complex Fourier coefficient Fn is defined by
Z π
1
Fn =
F (x) e−i n x dx, where
2π −π
n = 0, ±1, ±2, ±3, . . .
(6.2)
An alternative formulation, obtained upon using e−i n x = cos(n x) − i sin(n x), is given by:
F (x) = c0 +
∞
X
(cn cos(n x) + sn sin(n x)) ,
(6.3)
n=1
where: (i) c0 = F0 and cn = (Fn + F−n ) are the cosine Fourier coefficients, and (ii) sn = i (Fn − F−n ) are
the sine Fourier coefficients. Thus
Z π
1
c0 =
F (x) dx,
(6.4)
2π −π
Z
1 π
cn =
F (x) cos(n x) dx, for: n = 1, 2, 3, . . .
(6.5)
π −π
Z
1 π
F (x) sin(n x) dx, for: n = 1, 2, 3, . . .
(6.6)
sn =
π −π
If F is real valued, then F−n is the complex conjugate of Fn , so that
cn = 2 Re (Fn )
and sn = −2 Im (Fn )
for n > 0.
(6.7)
Generally, the issue of how well (or even in which sense), the Fourier Series in (6.1) or in (6.3) converges to
the function F is a rather subtle one. The main point of this problem is to conduct a numerical exploration
of some aspects of this question. In particular, consider the partial sums:
FN (x) = c0 +
N
X
(cn cos(n x) + sn sin(n x)) ,
(6.8)
n=1
where N is some natural number. Important questions are then: How well does FN approximate the
function F ? and How big is the error and how fast does it vanish as N → ∞.
Remark 6.1 Obviously, an important element in answering the questions above is how fast the Fourier
coefficients vanish as n → ∞. This is determined by how fast the power spectrum
p
1
Pn = |Fn | = c2n + s2n
(6.9)
2
vanishes as n → ∞ (Assume that F is real valued, so that (6.7) applies).
Pn gives information on ”how important” the n-th mode is in the Fourier Series expansion. The name
follows from the fact that (in many physical situations) one can interpret the square of the amplitude of
the n-th Fourier coefficient (i.e.: Pn2 ) as the amount of energy in the n-th mode of the solution (this is the
case for the wave equation, for example).
MIT, (Rosales)
6.2
Computer Exercise in Fourier Series.
16
Statement: Computer Exercise in Fourier Series
This problem objective is to “experimentally” study how Fourier series converge. For this purpose you
should use the following MatLab scripts
FouSerRedame.m
fourierSC.m
FSFun.m
FSoption.m
FSoptionP.m
heatSln.m
Put the scripts in a directory and start MatLab there. The help command will work as usual, in particular:
help FouSerReadme gives a description of all the scripts. Each script has its own detailed description. The
script you need is fourierSC. The others (except for heatSln) are helper scripts.
IMPORTANT:
• When you start the script fourierSC, it will ask you first the questions:
A. Do you want to use the fancy (with buttons) or the plain interface?
B. Up to how many terms in the Fourier series do you want to compute?
C. For which values you want to plot?
About B and C: Calculations will be done (and the results shown) for the partial sums in (6.8), for
the values N = 0, Nskip, 2*Nskip, . . . , Np. You will be asked to input Nskip and Np.
• After you finish answering the questions, fourierSC will present you with a list of options for functions
whose Fourier series it can compute: ”user’s choice”, and pre-selected. Check the scripts code to
make sure you understand exactly which functions you are dealing with!
• The script FSFun.m is the one used to input the ”user’s choice” selection, whatever function you program there will be the one used when ”user’s choice” is selected. A trivial example is pre-programmed
in FSFun.m, but you can alter it, and write there any function for which you want to investigate the
Fourier series — this is so you can go beyond the preselected options.
• The pre-selected options include smooth functions, as well as functions with various types of singular
behaviors — discontinuities, corners and cusps. The idea is to investigate how any particular ”singular”
behavior in the function is related to the convergence properties of its Fourier series.
p
A cusp is a singularity such as the one that |x| has at the origin. Other possibilities are |x|α ,
where 0 < α < 1. Investigate the effect of singularities of this type on the convergence!
The most important singular behavior whose effect on the Fourier series you should elucidate is
that of a discontinuity. How does it affect the convergence? How do the partial sums look like
in this case? Is there any peculiar behavior you can observe?
Odd an even functions are also provided in the pre-selections, so that you can see what effect symmetries
of the function have on its Fourier series. Can you think of other symmetries?
• The script fourierSC makes lots of plots, which will be made one on top of the other. You will need
to move the windows to see all the plots. These plots illustrate various aspects of how a Fourier
series behaves, as follows (this is the order in which the plots are done):
Exact function whose Fourier series is being computed.
Sine Fourier coefficients sn , as a function of n.
Cosine Fourier coefficients cn , as a functionqof n.
Semi-log plot of the power spectrum pn = c2n + s2n as a function of n.
Exponential decay will give a straight line in this kind of plot.
Log-log plot of the power spectrum as a function of n.
Algebraic decay will give a straight line in this kind of plot.
Partial sums FN = FN (x) — as in equation (6.8) — for N = 0:Nskip:Np.
MIT, (Rosales)
Computer Exercise in Fourier Series.
17
All these plots will be shown in the same window,
so you must look at them as they are done.
Relative error in the approximation FN , as a function of N .
Shows the error in the partial sums in (6.8), as a function of N , for N = 1:Np.
Semi-log plot of the relative error, as a function of N .
Log-log plot of the relative error, as a function of N .
This is what you should do:
Use the script fourierSC and report any ”patterns” or peculiar behavior you observe in the way Fourier series
converge. Experiment with the various choices. Look at the plots and think: what is happening? Many of
the plots are useful in figuring out how fast things converge (i.e. how fast do the Fourier coefficients vanish
as n → ∞). Look at the plots, look for patterns and trends. Make hypothesis as to what is happening and
check them by further experimentation. Use the script FSFun to produce functions where you can test
your hypothesis. Write your conclusions in the answers. Describe the evidence for your conclusions —
no proof is required, numerical evidence is enough, but you must produce, and describe, the evidence!
Think of it in the same way that you would think in the situation of a lab experimenter trying to figure
out what happens in some problem. A few plots with your answer are fine, but please, just a few!
IMPORTANT.
Anything smaller than about 10−14 is numerical error. Ignore it!
6.3
Answer: Computer Exercise in Fourier Series
There are very many properties that you could have discovered and given in answer to this problem. A
few are listed in what follows.
An obvious first observation is that, if F is even, then the sine Fourier coefficients sn vanish, while if F
is odd, then the cosine Fourier coefficients cn vanish. This observation is very easy to prove using the
formulas in (6.4 – 6.6). Other symmetries in the function F have similar consequences on the coefficients:
for example: what does F (π − x) = F (π + x) yield?
A second fairly immediate observation should be that, in the examples where F is smooth (infinitely many
derivatives), just a few terms in the Fourier series give amazingly good approximations — within 20 terms or
so the error becomes less than 10−15 , at the limit of the numerical resolution in the MatLab script. On
the other end, in the example where there is a corner in F (F continuous but the first derivative has a
discontinuity), the error goes down very slowly.8 Further, in the extreme cases where F has discontinuities,
at the location of the discontinuity there is an error that never seems to go down to zero! (More on this
below.) Thus,
There is a direct correspondence between the degree of smoothness in F and how “good” the Fourier series is.
This observation can be understood by the following simple calculation. Assume that F in (6.2) has a
derivative. Then, using the periodicity, a simple integration by parts shows that (for n 6= 0):
Z π
1
dF −i n x
Fn =
e
dx.
(6.10)
2inπ −π dx
8
Furthermore: the plots show that the error occurs mostly near the corner.
MIT, (Rosales)
Computer Exercise in Fourier Series.
18
If F has two derivatives, then we can do this again, and so on. Note that, each time we do this, an extra
factor of n appears in the denominator. What this means is that, the smoother F is (the more derivatives
it has), the faster the Fourier coefficients decay as n → ∞. Of course, this means that (6.1) converges
faster. In particular, if F has infinitely many derivatives, the Fourier coefficients decay faster than
any power of n and you get incredibly good convergence. Furthermore: it can be proved that, if F is
analytic, then its Fourier coefficients decay exponentially as n → ∞.
I recommend that you go back and check these facts with the MatLab scripts.
Many of the examples (i.e.: the Gaussians) have infinitely many
p derivatives.
The semi-log and log-log plots of the power spectrum Pn = c2n + s2n make
these properties evident.
On the other hand, consider the example with the corner. For this particular example we can calculate
the Fourier coefficients exactly — since the function is piecewise linear (do it). What you will find is that
the Fourier coefficients decay (as n → ∞) like n−2 . Again, you can verify this with MatLab: look at the
semi-log plots of the power spectrum.9 It can be shown that this decay rate is a general feature for functions
F that have corners (but are, otherwise, “well behaved”). For them the series in (6.1) converges roughly like
X 1
the series
— that is: very slow convergence.
n2
Another example that you should look at is that of the “rounded hat”. The almost corner this example
has at the top is not quite a corner: a derivative exists there, but it behaves badly (very much the way |x|1.5
behaves near x = 0.) In this case the Fourier coefficients decay like n−2.5 — hence, a bit better than in the
case of the hat, but not that much better.
Finally, the most interesting question:
What happens when F has a discontinuity?
Consider the sawtooth and square wave examples. In these cases the function F is either piecewise linear or
piecewise constant, so that one can compute exactly the Fourier coefficients Fn . If you do so, you will find out
that they decay (as n → ∞) like n−1 . This is a general
and it
X property of functions with discontinuities
X
is very bad news! As you know, the harmonic series
(1/n) does not converge at all, while
((−1)n /n)
has extremely poor convergence properties. But this is, precisely, the way that (6.1) converges in cases
with discontinuities. In fact, the following happens with the partial sums FN in (6.8) as N → ∞:
Near the discontinuity a thin region with oscillations arises. As the number of terms in the
series grows, this region becomes thinner, but the oscillations do not disappear; they just
develop of a shorter wavelength. The amplitude of the oscillations does not vanish: There
is an “overshot” at the discontinuity, which tends to a limit amplitude which is a constant
fraction of the jump at the discontinuity.
This is called the “Gibbs” phenomenon (see figures 6.1 and 6.2), a rather annoying10 property of Fourier
series. The MatLab script gibbsFSE.m gives a demonstration of the details of this phenomenon.
THE END.
9
10
Note that the even indexed coefficients vanish here; thus look only at the decay of the nonzero coefficients.
For those that need to use Fourier Series to approximate functions that may not be too “nice”.
MIT, (Rosales)
Computer Exercise in Fourier Series.
1
0.5
0.5
y=F
1
0
0
-0.5
-0.5
-1
-1
0
y=F
Fourier series added up to N = 100.
1
2
3
4
5
6
0
2
3
4
5
Rel. error in maximum = 0.1683
Fourier series added up to N = 200.
Fourier series added up to N = 300.
1
1
0.5
0.5
0
-0.5
-1
-1
1
2
3
4
Rel. error in maximum = 0.1681
5
6
6
0
-0.5
0
1
Rel. error in maximum = 0.1412
y=F
y=F
Fourier series added up to N = 25.
19
0
1
2
3
4
5
6
Rel. error in maximum = 0.1443
Figure 6.1: Computer Exercise in Fourier Series: Gibbs phenomenon. Convergence of the Fourier series for a
sawtooth function. Notice the oscillations near (and overshot at) the position of the discontinuity.
MIT, (Rosales)
Computer Exercise in Fourier Series.
1.1
1
1
0.9
0.9
y=F
1.1
0.8
0.8
0.7
0.7
0.6
0.6
0.5
2.5
y=F
Fourier series added up to N = 200.
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
0.5
2.5
3.5
2.8
2.9
3
3.1
3.2
3.3
Fourier series added up to N = 300.
Fourier series added up to N = 600.
1.1
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
2.6
2.7
Rel. error in maximum = 0.1681
1.1
0.5
2.5
2.6
Rel. error in maximum = 0.1683
y=F
y=F
Fourier series added up to N = 100.
2.7
2.8
2.9
3
3.1
3.2
3.3
Rel. error in maximum = 0.1443
20
3.4
3.5
0.5
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.5
3.4
3.5
Rel. error in maximum = 0.1166
Figure 6.2: Computer Exercise in Fourier Series: Gibbs phenomenon. Detail near the discontinuity. As more
and more terms are added, the overshot at the discontinuity does not go down, with very high frequencies
occurring near it.
Download