Greens Functions
Greens Functions
Mark J. McCready
Professor and Chair of Chemical Engineering
University of Notre Dame
Notre Dame, IN 46556
USA
[email protected]
http://www.nd.edu/~mjm/
It is copyrighted to the extent allowed by which ever laws pertain to the World Wide Web and the Internet.
I would hope that as a professional courtesy, this notice remain visible to other users.
There is no charge for copying and dissemination
Version: 11/20/98
Initialization
This notebook is a bit rough in format (you need to do it order as some of the names will get written over) but it is
an exploration of the Green's function and its use to solve inhomogeneous ODE's. You will have to work through
it to get much benefit.
We will need this add-on package which defines the delta function and the Heaviside function -- which is called
the UnitStep function
<< Calculus`DiracDelta`
On some setups, you may need to use a "Needs" command.
greens.nb
Needs["Calculus``DiracDelta` "]
0.5
-1
-0.5
0.5
-0.5
-1
Graphics
Table@DiracDelta@iD, 8i, -3, 3<D
80, 0, 0, DiracDeltaH0L, 0, 0, 0<
1
0.8
0.6
0.4
0.2
-3
-2
Graphics
-1
greens.nb
0.2
-0.05
-0.1
-0.15
-0.2
-0.25
Graphics
0.4
0.6
0.8
greens.nb
0.2
0.4
0.6
0.8
0.8
-0.025
-0.05
-0.075
-0.1
-0.125
-0.15
Graphics
Plot@greenfunc1 . x -> .1, 8t, 0, 1<D
0.2
-0.02
-0.04
-0.06
-0.08
Graphics
0.4
0.6
greens.nb
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
-0.2
-0.25
Graphics
We think, what else could g[x,t] look like since it has have a singular 2nd derivative and a constant 1st
derivative. Now switch x and t.
Plot@greenfunc1 . t -> .1, 8x, 0, 1<D
0.2
-0.02
-0.04
-0.06
-0.08
Graphics
0.4
0.6
0.8
greens.nb
0.2
0.4
0.6
0.8
0.8
-0.05
-0.1
-0.15
-0.2
-0.25
Graphics
Plot@greenfunc1 . t -> .8, 8x, 0, 1<D
0.2
-0.025
-0.05
-0.075
-0.1
-0.125
-0.15
Graphics
0.4
0.6
greens.nb
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
-0.2
-0.25
Graphics
Interesting... we see that greenfunc1 is symmetric in x and t. This is likely to always be the case if the
boundary conditions are homogenous.
Now solve the inhomogeneous equation for different powers of x as the inhomogeneities. First x0
ans10 = Integrate@1 greenfunc1, 8x, 0, 1<D
1
t i t2
1y
UnitStepHtL t 2 - + jj- + t - zz UnitStepHt - 1L
2
2 k 2
2{
It does not change much when simplified, but not that t2 is the leading term.
ans10x = FullSimplify@ans10D
General::spell1 : Possible spelling error: new symbol name "ans10x" is similar to existing symbol "ans10".
1
Ht Ht UnitStepHtL - 1L - Ht - 1L2 UnitStepHt - 1LL
2
greens.nb
greenans1
0.2
0.4
0.6
0.8
-0.02
-0.04
-0.06
-0.08
-0.1
-0.12
Graphics
Down to DSolve answer
ans11 = Integrate@x greenfunc1, 8x, 0, 1<D
1
t i t3
t
1y
UnitStepHtL t 3 - + jj- + - zz UnitStepHt - 1L
6
6 k 6
2
3{
ans11x = FullSimplify@ans11D
General::spell1 : Possible spelling error: new symbol name "ans11x" is similar to existing symbol "ans11".
1
HUnitStepHtL t3 - t - Ht 3 - 3 t + 2L UnitStepHt - 1LL
6
greens.nb
0.2
0.4
0.6
0.8
-0.01
-0.02
-0.03
-0.04
-0.05
-0.06
Graphics
ans12 = Integrate@x ^ 2 greenfunc1, 8x, 0, 1<D
t
t
1y
1
i t4
UnitStepHtL t4 - + jj- + - zz UnitStepHt - 1L
12 k 12
3
4{
12
ans12x = FullSimplify@ans12D
General::spell1 : Possible spelling error: new symbol name "ans12x" is similar to existing symbol "ans12".
1
HUnitStepHtL t 4 - t - Ht4 - 4 t + 3L UnitStepHt - 1LL
12
10
greens.nb
0.2
0.4
0.6
0.8
-0.01
-0.02
-0.03
-0.04
Graphics
ans16 = Integrate@x ^ 6 greenfunc1, 8x, 0, 1<D
t
t
1y
1
i t8
UnitStepHtL t8 - + jj- + - zz UnitStepHt - 1L
56 k 56
7
8{
56
ans16x = FullSimplify@ans16D
General::spell1 : Possible spelling error: new symbol name "ans16x" is similar to existing symbol "ans16".
1
Ht Ht 7 UnitStepHtL - 1L - Ht8 - 8 t + 7L UnitStepHt - 1LL
56
plot4 = Plot@ans16x, 8t, 0, 1<D
0.2
-0.002
-0.004
-0.006
-0.008
-0.01
Graphics
0.4
0.6
0.8
greens.nb
11
0.2
0.4
0.6
0.8
-0.02
-0.04
-0.06
-0.08
-0.1
-0.12
Graphics
We see that uniform cooling gives the greatest deviation and is, not surprisingly, symmetric. A higher power of x
is more asymmetric but the effect is less (is this obvious?).
2
Now we can solve the problem where the operator is
2 + k and the boundary
2
HxL
1
99gHtL HsinHk t - k xL UnitStepHt - xL + cosHk tL sinHk xL UnitStepH-xL k
sinHk tL HcscHkL sinHk - k xL UnitStepH1 - xL + cotHkL sinHk xL UnitStepH-xLLL==
At this point, g[ ] is effectively now g[x,t] as we would like.
Note that (as expected), the Green's function consists of sin/cos type terms as required by the operator.
12
greens.nb
1
H-cscHkL sinHk tL sinHk - k xL UnitStepH1 - xL + sinHk Ht - xLL UnitStepHt - xL +
k
cscHkL sinHk - k tL sinHk xL UnitStepH-xLL
Now plot the Green's function at some values. First choose k to be small to get the answers from the
example above.
pl21 = Plot@greenfunc2 . 8x -> .5, k -> 0.001<, 8t, 0, 1<D
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
-0.2
-0.25
Graphics
pl22 = Plot@greenfunc2 . 8x -> .8, k -> .001<, 8t, 0, 1<D
0.2
-0.025
-0.05
-0.075
-0.1
-0.125
-0.15
Graphics
0.4
0.6
0.8
greens.nb
13
0.2
0.4
0.6
0.8
0.6
0.8
-0.02
-0.04
-0.06
-0.08
Graphics
Show@pl21, pl22, pl23D
0.2
0.4
-0.05
-0.1
-0.15
-0.2
-0.25
Graphics
Now change k to a larger value, k=3
pl31 = Plot@greenfunc2 . 8x -> .5, k -> 3<, 8t, 0, 1<D
14
greens.nb
0.2
0.4
0.6
0.8
-0.5
-1
-1.5
-2
Graphics
pl32 = Plot@greenfunc2 . 8x -> .8, k -> 3<, 8t, 0, 1<D
General::spell1 : Possible spelling error: new symbol name "pl32" is similar to existing symbol "pl23".
0.2
-0.2
-0.4
-0.6
-0.8
-1
-1.2
Graphics
0.4
0.6
0.8
greens.nb
15
0.2
0.4
0.6
0.8
0.6
0.8
-0.1
-0.2
-0.3
-0.4
-0.5
-0.6
-0.7
Graphics
Show@pl31, pl32, pl33D
0.2
0.4
-0.5
-1
-1.5
-2
Graphics
If we increase k still further, we can see the expected oscillation in g[x,t]
Again increase k
pl51 = Plot@greenfunc2 . 8x -> .5, k -> 10<, 8t, 0, 1<D
16
greens.nb
0.15
0.1
0.05
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
Graphics
pl52 = Plot@greenfunc2 . 8x -> .8, k -> 10<, 8t, 0, 1<D
0.15
0.1
0.05
0.2
-0.05
-0.1
-0.15
Graphics
0.4
0.6
0.8
greens.nb
17
0.15
0.1
0.05
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
Graphics
Show@pl51, pl52, pl53D
0.15
0.1
0.05
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
Graphics
Perhaps some insight into the Green's function is emerging.
homogeneous (e.g., L [g] ==0) operator but with a kink at t=x.
General::spell1 : Possible spelling error: new symbol name "ans31" is similar to existing symbol "ans1".
18
greens.nb
sinHk tL tanH k L
HcosHk Ht - 1LL - 1L UnitStepHt - 1L
HcosHk tL - 1L UnitStepHtL
- 2 2 + 2 - 2
k
k
k
We see the required sin(kt), cos(kt) behavior.
ans31x = FullSimplify@ans31D
General::spell1 : Possible spelling error: new symbol name "ans31x" is similar to existing symbol "ans31".
0.2
0.4
0.6
0.8
0.8
-0.02
-0.04
-0.06
-0.08
-0.1
-0.12
Graphics
pl62 = Plot@ans31x . k -> 1, 8t, 0, 1<D
0.2
-0.02
-0.04
-0.06
-0.08
-0.1
-0.12
-0.14
Graphics
0.4
0.6
greens.nb
19
0.2
0.4
0.6
0.8
0.8
-0.05
-0.1
-0.15
-0.2
Graphics
pl64 = Plot@ans31x . k -> 5, 8t, 0, 1<D
0.08
0.06
0.04
0.02
0.2
Graphics
0.4
0.6
20
greens.nb
0.04
0.03
0.02
0.01
0.2
0.4
0.6
0.8
0.8
-0.01
-0.02
Graphics
pl66 = Plot@ans31x . k -> 100, 8t, 0, 1<D
0.0002
0.00015
0.0001
0.00005
0.2
Graphics
0.4
0.6
greens.nb
21
Show@pl61, pl62, pl63, pl64, pl65, pl66, PlotRange -> 8-.23, .1<D
0.1
0.05
0.2
0.4
0.6
0.8
-0.05
-0.1
-0.15
-0.2
Graphics
As the response frequency goes up, the amplitude goes down (does this make sense?)
Now try a higher power of x
Now choose f[x] = x2 .
ans4 = Integrate@x ^ 2 greenfunc2, 8x, 0, 1<D
1
4 H-Hk2 + 2 cosHkL - 2L cscHkL sinHk tL +
k
H-k2 t2 + Hk2 - 2L cosHk - k tL - 2 k sinHk - k tL + 2L UnitStepHt - 1L +
Hk2 t 2 + 2 cosHk tL - 2L UnitStepHtLL
22
greens.nb
0.2
0.4
0.6
0.8
0.8
-0.01
-0.02
-0.03
-0.04
Graphics
pl72 = Plot@ans4x . k -> 1, 8t, 0, 1<D
0.2
-0.01
-0.02
-0.03
-0.04
Graphics
0.4
0.6
greens.nb
23
0.2
0.4
0.6
0.8
-0.01
-0.02
-0.03
-0.04
-0.05
-0.06
Graphics
green2
0.04
0.03
0.02
0.01
0.2
-0.01
Graphics
Go down to the DSolve answer
0.4
0.6
0.8
24
greens.nb
0.02
0.01
0.2
0.4
0.6
0.8
0.8
-0.01
Graphics
pl76 = Plot@ans4x . k -> 100, 8t, 0, 1<D
0.0003
0.0002
0.0001
0.2
-0.0001
-0.0002
Graphics
0.4
0.6
greens.nb
25
0.04
0.02
0.2
0.4
0.6
0.8
-0.02
-0.04
Graphics
We see some asymmetry that is due to the asymmetric forcing. Again the amplitude decreases with frequency.
26
greens.nb
Hewu@xD . n -> 0L
1
Hx2 - xL
2
dsolveans
0.2
0.4
0.6
0.8
-0.02
-0.04
-0.06
-0.08
-0.1
-0.12
Graphics
back to Green' s function answer
This looks OK.
How about the other L?
We can get a general solution fro xn , but it involves functions that have possibly ambiguous choices for the path of
integration. Thus we just choose x2 .
ans6 = DSolve@
8D@u@xD, 8x, 2<D + k ^ 2 u@xD - x ^ 2 == 0, u@0D == 0, u@1D == 0<, u@xD, xD
General::spell1 : Possible spelling error: new symbol name "ans6" is similar to existing symbol "ans16".
General::spell : Possible spelling error: new symbol name "ans6x" is similar to existing symbols 8ans16x, ans6<.
greens.nb
27
dsolve2
0.04
0.03
0.02
0.01
0.2
0.4
0.6
0.8
-0.01
Graphics
Go to the Green' s function answer
Or, just look here. Here is the answer from above that used the Green's Function. It matches.
Show@pl74D
0.04
0.03
0.02
0.01
0.2
-0.01
Graphics
0.4
0.6
0.8