Math 257/316 Assignment 8 Due Mon. Mar. 23 in class

advertisement
Math 257/316 Assignment 8
Due Mon. Mar. 23 in class
1. Consider the wave8equation utt = c2 uxx , 9 1 < x < 1, with initial position
< x + 1 if 1 < x  0 =
1 x if 0 < x < 1
u(x, 0) = f (x) =
and with initial velocity ut (x, 0) = 0.
:
;
0
otherwise
Sketch the shape of the solution u(x, t) at t = 0, t = 1/(2c), t = 1/c, and t = 2/c.
By D’Alembert’s formula, the solution is u(x, t) = 12 [f (x ct) + f (x + ct)], so

1
1
1
1
u(x, 0) = f (x), u(x, ) =
f (x
) + f (x + )
2c
2
2
2
1
1
2
1
u(x, ) = [f (x 1) + f (x + 1)] , u(x, ) = [f (x 2) + f (x + 2)] ,
c
2
c
2
from which expressions it is easy to draw the graphs, by drawing the suitably translated
graphs of 12 f (x), and adding where there is overlap:
1
2. spreadsheet project: Consider the following initial-boundary value problem:
utt = 16uxx ,
u(0, t) = 0
u(x, 0) = e
0 < x < ⇡/2, t > 0
and
50(x
⇡/4)2
u(⇡/2, t) = 0
,
ut (x, 0) = 0.
a) Use a spreadsheet and a finite di↵erence approximation to solve the problem
numerically, taking x = ⇡/80 and t = 0.004 (as usual, you can use the
examples on the website, or build your own from previous spreadsheets, but
remember to properly account for the initial conditions). Turn in plots of the
solution at times t = 0.1, t = 0.2, t = 0.3, and t = 0.4. Describe in a few words
the behaviour of the solution.
See attached spreadsheet. The initial data splits into two waves, moving left and
right at constant speed. These waves reflect at the boundary, change sign, and
move back toward the centre, eventually passing through each other, reflecting
and inverting again, and returning to the centre in their original position. This
then repeats.
b) Change the boundary conditions to Neumann BCs: ux (0, t) = ux (⇡/2, t) = 0,
and repeat the computation from part (a), generating the same plots. Describe
in a few words how the behaviour di↵ers from the case of Dirichlet BCs.
See the attached sheet. In this case, the waves reflect o↵ the boundary without
changing sign, and so the solution returns to its initial shape in half the time it
takes for Dirichlet BCs.
2
Sheet1
k= 0
Parameters
dx
dt
c
K
0.04
0
4
0.17
t= 0
0
0
0
u(x,0)
f(x)
g(x)
x
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0.01 0.02 0.06 0.15 0.29 0.5 0.73 0.93
0 0.01 0.02 0.06 0.15 0.29 0.5 0.73 0.93
0
0
0
0
0
0
0
0
0
1 0.93 0.73 0.5
1 0.93 0.73 0.5
0
0
0
0
0 0.04 0.08 0.12 0.16 0.2 0.24 0.27 0.31 0.35 0.39 0.43 0.47 0.51 0.55 0.59 0.63 0.67 0.71 0.75 0.79 0.82 0.86 0.9
t
0
0
0.01
position x 0.01
0.02
time t
0.02
boundary conditions
initial displacement0.02
f(x)
0.03
initial velocity g(x)
solution u(x,t) 0.03
0.04
0.04
0.04
0.05
0.05
0.06
0.06
0.06
0.07
0.07
0.08
0.08
0.08
0.09
0.09
0.1
0.1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0 0.8 0
0
0 0.6 0
0
0
0
0.4
0
0
0
0
0 0.2 0
0
0 0 0
u(x,t)
0
0
0
-0.2
0
0
0
0
0 -0.4 0
0
0 -0.6 0
0
0
0
-0.8
0
0
0
0
0 -1 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0.01
0
0 0.01
0 0.01 0.02
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0.01
0
0 0.01
0.1
0.2
0
0 0.01
0 0.01 0.02
0 0.01 0.03
0.01 0.02 0.04
0.01 0.02 0.05
0.01 0.03 0.07
0.02 0.05 0.1
0.03 0.06 0.13
0.04 0.09 0.16
0
0
0
0
0
0
0
0
0
0
0
0
0
0.01
0.01
0.01
0.02
0.3
0.03
0.04
0.06
0.08
0.11
0.14
0.18
0.22
0.26
0
0
0
0
0
0
0
0
0
0
0
0.01
0.01
0.02
0.03
0.04
0.05
0.4
0.07
0.09
0.12
0.16
0.2
0.24
0.28
0.33
0.37
0
0
0 0.01 0.02 0.06 0.15
0
0
0 0.01 0.02 0.07 0.15
Numerical solution
0
0
0 0.01 0.03 0.08 0.17
0
0 0.01 0.02 0.04 0.09 0.19
0
0 0.01 0.02 0.06 0.12 0.22
0
0 0.01 0.03 0.08 0.15 0.26
0 0.01 0.02 0.05 0.1 0.19 0.31
0 0.01 0.03 0.07 0.13 0.23 0.35
0.01 0.02 0.04 0.09 0.17 0.28 0.39
0.01 0.02 0.06 0.12 0.21 0.32 0.43
0.01 0.03 0.08 0.15 0.25 0.37 0.46
0.02 0.05 0.1 0.19 0.3 0.41 0.49
0.03 0.07 0.14 0.23 0.35 0.45 0.5
0.04 0.09 0.17 0.28 0.39 0.48 0.5
0.06 0.12 0.21 0.33 0.43 0.49 0.49
0.08 0.15 0.26 0.37 0.46 0.5 0.46
0.11 0.19 0.3 0.41 0.49 0.49 0.43
0.5
0.6
0.7
0.8
0.9
1
0.14 0.24 0.35 0.45 0.5 0.47 0.39
x
0.17 0.28 0.39 0.48 0.5 0.45 0.34
0.21 0.33 0.43 0.49 0.49 0.41 0.29
0.26 0.37 0.46 0.5 0.46 0.36 0.24
0.3 0.41 0.49 0.49 0.43 0.31 0.19
0.35 0.45 0.5 0.47 0.38 0.26 0.15
0.39 0.48 0.5 0.44 0.34 0.22 0.12
0.43 0.49 0.48 0.41 0.29 0.17 0.08
0.46 0.5 0.46 0.36 0.24 0.13 0.06
Page 1
0.29 0.5
0.3 0.5
0.31 0.51
0.34 0.52
0.36 0.53
0.4 0.53
0.43 0.54
0.46 0.53
0.48 0.52
0.5 0.5
0.5 0.47
0.49 0.43
0.48 0.39
0.45 0.34
0.41 0.29
0.36 0.24
0.32 0.2
1.1
0.27 0.15
0.22 0.12
0.17 0.09
0.13 0.06
0.1 0.04
0.07 0.03
0.05 0.02
0.03 0.01
0.02 0.01
0.73
0.73
0.72
0.7
0.68
0.64
0.6
0.56
0.5
0.45
0.39
0.33
0.28
0.23
0.18
0.14
0.1
1.2
0.08
0.05
0.04
0.02
0.01
0.01
0.01
0
0
0.93
0.92
0.89
0.84
0.78
0.71
0.63
0.55
0.47
0.39
0.31
0.25
0.19
0.14
0.1
0.07
0.05
1.3
0.03
0.02
0.01
0.01
0
0
0
0
0
1
0.99
0.95
0.89
0.82
0.73
0.64
0.54
0.45
0.36
0.28
0.21
0.16
0.11
0.08
0.05
0.03
1.4
0.02
0.01
0.01
0
0
0
0
0
0
0.93 0.73 0.5
0.92 0.73 0.5
0.89 0.72 0.51
0.84 0.7 0.52
0.78 0.68 0.53
0.71 0.64 0.53
0.63 0.6 0.54
0.55 0.56 0.53
0.47 0.5 0.52
0.39 0.45 0.5
0.31 0.39 0.47
0.25 0.33 0.43
0.19 0.28 0.39
0.14 0.23 0.34
0.1 0.18 0.29
0.07 0.14 0.24
0.05 0.1 0.2
1.5
1.6
0.03 0.08 0.15
0.02 0.05 0.12
0.01 0.04 0.09
0.01 0.02 0.06
0 0.01 0.04
0 0.01 0.03
0 0.01 0.02
0
0 0.01
0
0 0.01
Sheet1
k= 0
Parameters
dx
dt
c
K
0.04
0
4
0.17
t= 0
0
0
0
u(x,0)
f(x)
g(x)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0.01 0.02 0.06 0.15 0.29 0.5 0.73 0.93
0 0.01 0.02 0.06 0.15 0.29 0.5 0.73 0.93
0
0
0
0
0
0
0
0
0
1 0.93 0.73 0.5
1 0.93 0.73 0.5
0
0
0
0
x
0 0.04 0.08 0.12 0.16 0.2 0.24 0.27 0.31 0.35 0.39 0.43 0.47 0.51 0.55 0.59 0.63 0.67 0.71 0.75 0.79 0.82 0.86 0.9
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
t
0
0
0.01
position x 0.01
0.02
time t
0.02
boundary conditions
initial displacement0.02
f(x)
0.03
initial velocity g(x)
solution u(x,t) 0.03
0.04
0.04
0.04
0.05
0.05
0.06
0.06
0.06
0.07
0.07
0.08
0.08
0.08
0.09
0.09
0.1
0.1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0 0.8 0
0
0 0.6 0
0
0
0
0.4
0
0
0
0
0 0.2 0
0
0 0 0
u(x,t)
0
0
0
-0.2
0
0
0
0
0 -0.4 0
0
0 -0.6 0
0
0
0
-0.8
0
0
0
0
0 -1 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0.01
0
0 0.01
0 0.01 0.02
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0.01
0
0 0.01
0.1
0.2
0
0 0.01
0 0.01 0.02
0 0.01 0.03
0.01 0.02 0.04
0.01 0.02 0.05
0.01 0.03 0.07
0.02 0.05 0.1
0.03 0.06 0.13
0.04 0.09 0.16
0
0
0
0
0
0
0
0
0
0
0
0
0
0.01
0.01
0.01
0.02
0.3
0.03
0.04
0.06
0.08
0.11
0.14
0.18
0.22
0.26
0
0
0
0
0
0
0
0
0
0
0
0.01
0.01
0.02
0.03
0.04
0.05
0.4
0.07
0.09
0.12
0.16
0.2
0.24
0.28
0.33
0.37
0
0
0 0.01 0.02 0.06 0.15
0
0
0 0.01 0.02 0.07 0.15
Numerical solution
0
0
0 0.01 0.03 0.08 0.17
0
0 0.01 0.02 0.04 0.09 0.19
0
0 0.01 0.02 0.06 0.12 0.22
0
0 0.01 0.03 0.08 0.15 0.26
0 0.01 0.02 0.05 0.1 0.19 0.31
0 0.01 0.03 0.07 0.13 0.23 0.35
0.01 0.02 0.04 0.09 0.17 0.28 0.39
0.01 0.02 0.06 0.12 0.21 0.32 0.43
0.01 0.03 0.08 0.15 0.25 0.37 0.46
0.02 0.05 0.1 0.19 0.3 0.41 0.49
0.03 0.07 0.14 0.23 0.35 0.45 0.5
0.04 0.09 0.17 0.28 0.39 0.48 0.5
0.06 0.12 0.21 0.33 0.43 0.49 0.49
0.08 0.15 0.26 0.37 0.46 0.5 0.46
0.11 0.19 0.3 0.41 0.49 0.49 0.43
0.5
0.6
0.7
0.8
0.9
1
0.14 0.24 0.35 0.45 0.5 0.47 0.39
x
0.17 0.28 0.39 0.48 0.5 0.45 0.34
0.21 0.33 0.43 0.49 0.49 0.41 0.29
0.26 0.37 0.46 0.5 0.46 0.36 0.24
0.3 0.41 0.49 0.49 0.43 0.31 0.19
0.35 0.45 0.5 0.47 0.38 0.26 0.15
0.39 0.48 0.5 0.44 0.34 0.22 0.12
0.43 0.49 0.48 0.41 0.29 0.17 0.08
0.46 0.5 0.46 0.36 0.24 0.13 0.06
Page 1
0.29 0.5
0.3 0.5
0.31 0.51
0.34 0.52
0.36 0.53
0.4 0.53
0.43 0.54
0.46 0.53
0.48 0.52
0.5 0.5
0.5 0.47
0.49 0.43
0.48 0.39
0.45 0.34
0.41 0.29
0.36 0.24
0.32 0.2
1.1
0.27 0.15
0.22 0.12
0.17 0.09
0.13 0.06
0.1 0.04
0.07 0.03
0.05 0.02
0.03 0.01
0.02 0.01
0.73
0.73
0.72
0.7
0.68
0.64
0.6
0.56
0.5
0.45
0.39
0.33
0.28
0.23
0.18
0.14
0.1
1.2
0.08
0.05
0.04
0.02
0.01
0.01
0.01
0
0
0.93
0.92
0.89
0.84
0.78
0.71
0.63
0.55
0.47
0.39
0.31
0.25
0.19
0.14
0.1
0.07
0.05
1.3
0.03
0.02
0.01
0.01
0
0
0
0
0
1
0.99
0.95
0.89
0.82
0.73
0.64
0.54
0.45
0.36
0.28
0.21
0.16
0.11
0.08
0.05
0.03
1.4
0.02
0.01
0.01
0
0
0
0
0
0
0.93 0.73 0.5
0.92 0.73 0.5
0.89 0.72 0.51
0.84 0.7 0.52
0.78 0.68 0.53
0.71 0.64 0.53
0.63 0.6 0.54
0.55 0.56 0.53
0.47 0.5 0.52
0.39 0.45 0.5
0.31 0.39 0.47
0.25 0.33 0.43
0.19 0.28 0.39
0.14 0.23 0.34
0.1 0.18 0.29
0.07 0.14 0.24
0.05 0.1 0.2
1.5
1.6
0.03 0.08 0.15
0.02 0.05 0.12
0.01 0.04 0.09
0.01 0.02 0.06
0 0.01 0.04
0 0.01 0.03
0 0.01 0.02
0
0 0.01
0
0 0.01
3. Solve the wave equation problem
utt = 4uxx ,
u(x, 0) =
⇢
0 < x < 1, t > 0,
0 0  x < 1/4, 3/4 < x  1
1
1/4  x  3/4
ut (x, 0) = 0
a) with Dirichlet BCs: u(0, t) = 0 = u(1, t)
As derived in class (by separating variables), for Dirichlet BCs, the general
solution is
u(x, t) =
1
X
[An cos(2n⇡t) + Bn sin(2n⇡t)] sin(n⇡x),
n=1
with
Bn =
2
2n⇡
so that
u(x, t) =
Z
1
ut (x, 0) sin(n⇡x)dx = 0,
0
1
X
An cos(2n⇡t) sin(n⇡x),
n=1
and
An = 2
Z
1
u(x, 0) sin(n⇡x)dx = 2
0
Z
3/4
sin(n⇡x)dx
1/4
2
2
3/4
cos(n⇡x)|1/4 =
(cos(n⇡/4)
n⇡
n⇡
=
cos(3n⇡/4)) .
b) with Neumann BCs: ux (0, t) = 0 = ux (1, t).
For Neumann BCs, the separation of variables yields cosines (rather than sines)
for the X problem. And notice that for the constant solution (corresponding to
zero separation constant), the T problem is T 00 (t) = 0 whose solution is a linear
function of t, and so we have
u(x, t) =
1
X
C0 D0
+
t+
[Cn cos(2n⇡t) + Dn sin(2n⇡t)] cos(n⇡x),
2
2
n=1
with
2
Dn =
2n⇡
Z
1
ut (x, 0) cos(n⇡x)dx = 0 (n = 1, 2, 3, . . .),
0
3
D0 = 0,
so that
u(x, t) =
1
C0 X
+
Cn cos(2n⇡t) cos(n⇡x),
2
n=1
with
C0 = 2
Z
1
u(x, 0)dx = 1
0
and for n = 1, 2, 3, . . .,
Z 1
Z
Cn = 2
u(x, 0) cos(n⇡x)dx = 2
0
=
3/4
cos(n⇡x)dx
1/4
2
2
3/4
sin(n⇡x)|1/4 =
(sin(3n⇡/4)
n⇡
n⇡
sin(n⇡/4)) .
In each case, find the earliest positive time t at which the solution u(x, t) is exactly
the same as at time 0: u(x, t) = u(x, 0) for all x. Interpret your answer in terms of
reflecting waves.
In the Dirichlet case, notice
A1 =
2
(cos(⇡/4)
⇡
4
cos(3⇡/4)) = p 6= 0
2⇡
and the period of cos(2⇡t) is 1. Furthermore, cos(2n⇡t) is 1-periodic for all n =
2, 3, 4, . . . as well. So we conclude that the solution repeats itself (for the first time)
at time t = 1: u(0, t) = u(1, t).
In the Neumann case notice that whenever n is odd,
2
n⇡
2
=
n⇡
2
=
n⇡
Cn =
(sin(n⇡/4 + 2n⇡/4)
sin(n⇡/4))
(sin(n⇡/4) cos(n⇡/2) + cos(n⇡/4) sin(n⇡/2)
⇣
⌘
( 1)(n 1)/2 cos(n⇡/4) sin(n⇡/4) = 0.
sin(n⇡/4))
So the solution contains terms with cos(2n⇡t) only for n even, and is therefore 1/2periodic. That is, the solution first repeats at time t = 1/2: u(1/2, t) = u(0, t).
The Dirichlet solution takes twice as long to repeat because when the waves reflect at
the boundary, they change sign, and so it takes two reflections to return the waves
to their original position (and with the same sign) in the middle of the interval.
The Neumann solution requires only one reflection to repeat, since the waves do not
change sign.
4
Download