You are on page 1of 6

Some results for the common hyberbolic tangent-based grid stretching

schemes associated with Marcel Vinokur


The one-sided stretching scheme and its analytic version in the limit as ∆® 0.

Tanh@∆ HΞ  L - 1LD
s@∆ _, L_, Ξ _D := 1 +
Tanh@∆D
s@∆, L, ΞD  FullSimplify
Limit@%, ∆ ® 0D
Ξ
1 + Coth@∆D TanhA∆ - 1 + E
L

Ξ
L

Partial derivatives with respect to each variable, including the limiting cases.

D@s@∆, L, xD, xD
Limit@%, ∆ ® 0D
x 2
∆ Coth@∆D SechAI- 1 + M ∆E
L

L
1
L

D@s@∆, L, xD, ∆D
Limit@%, ∆ ® 0D
x x 2 x
-1 + Coth@∆D SechA - 1 + ∆E - Csch@∆D2 TanhA - 1 + ∆E
L L L
0

D@s@∆, L, xD, LD
Limit@%, ∆ ® 0D
x 2
x ∆ Coth@∆D SechAI- 1 + M ∆E
L
-
L2
x
-
L2

Some numerical results for implementation verification

N@s@∆, L, ΞD . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D


N@D@s@∆, L, ΞD, ∆D . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D
N@D@s@∆, L, ΞD, LD . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D
N@D@s@∆, L, ΞD, ΞD . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D

1.130109424675245 ´ 10-6

- 2.053316509625048 ´ 10-6

- 4.827691460278840 ´ 10-7

0.00001303476694275287
2 HyperbolicTangent.nb

N@s@∆, L, ΞD . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D


N@D@s@∆, L, ΞD, ∆D . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D
N@D@s@∆, L, ΞD, LD . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D
N@D@s@∆, L, ΞD, ΞD . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D
0.001553191024452532

- 0.002512942959289942

- 0.0008866151849355177

0.01950553406858139

N@s@∆, L, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D


N@D@s@∆, L, ΞD, ∆D . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D
N@D@s@∆, L, ΞD, LD . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D
N@D@s@∆, L, ΞD, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D

5.388915112675453 ´ 10-6

- 9.425182395066187 ´ 10-6

- 5.410484940505296 ´ 10-6

0.005410484940505296

N@s@∆, L, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D


N@D@s@∆, L, ΞD, ∆D . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D
N@D@s@∆, L, ΞD, LD . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D
N@D@s@∆, L, ΞD, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D

5.367402865013899 ´ 10-11

- 9.392957375935146 ´ 10-11

- 5.367403079566020 ´ 10-11

0.005367403079566020

Limit@s@∆, L, ΞD, ∆ ® 0D . 8L ® 2, Ξ ® 1  11<


Limit@D@s@∆, L, ΞD, ∆D, ∆ ® 0D . 8L ® 2, Ξ ® 1  11<
Limit@D@s@∆, L, ΞD, LD, ∆ ® 0D . 8L ® 2, Ξ ® 1  11<
Limit@D@s@∆, L, ΞD, ΞD, ∆ ® 0D . 8L ® 2, Ξ ® 1  11<
1
22
0

1
-
44
1
2

A particular solution useful for checking solves for ∆ satisfying some conditions
HyperbolicTangent.nb 3

Plot@s@2.345678901234567, 2, ΞD, 8Ξ, 0, 2<D


345 678 901 234 567
NBsB2 + , 2, 1  2F, 16F
1 000 000 000 000 000
1.0

0.8

0.6

0.4

0.2

0.5 1.0 1.5 2.0

0.04012773950620386

The two-sided stretching scheme and its analytic version in the limit as ∆® 0.

1
Tanh@∆ HΞ  L - 1  2LD
u@∆ _, L_, Ξ _D := 1+
2 Tanh@∆  2D
u@∆, L, ΞD  FullSimplify
Limit@%, ∆ ® 0D
1 ∆ 1 Ξ
1 + CothA E TanhA∆ - + E
2 2 2 L

Ξ
L

Partial derivatives with respect to each variable, including the limiting cases.

D@u@∆, L, xD, ∆D  FullSimplify


Limit@%, ∆ ® 0D
∆ 2 1 x 2 2x
CschA E SechAI- + M ∆E IHL - 2 xL Sinh@∆D + L SinhAI- 1 + M ∆EM
2 2 L L
-
8L

D@u@∆, L, xD, LD  FullSimplify


Limit@%, ∆ ® 0D
∆ 1 x 2
x ∆ CothA E SechAI- + M ∆E
2 2 L
-
2 L2
x
-
L2
4 HyperbolicTangent.nb

D@u@∆, L, xD, xD  FullSimplify


Limit@%, ∆ ® 0D
∆ 1 x 2
∆ CothA E SechAI- + M ∆E
2 2 L

2L
1
L

Some numerical results for implementation verification

N@u@∆, L, ΞD . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D


N@D@u@∆, L, ΞD, ∆D . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D
N@D@u@∆, L, ΞD, LD . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D
N@D@u@∆, L, ΞD, ΞD . 8∆ ® 7, L ® 3, Ξ ® 1  9<, 16D
0.0006192752099952831

- 0.0005055862703645726

- 0.0002643833885364380

0.007138351490483826

N@u@∆, L, ΞD . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D


N@D@u@∆, L, ΞD, ∆D . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D
N@D@u@∆, L, ΞD, LD . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D
N@D@u@∆, L, ΞD, ΞD . 8∆ ® 3, L ® 2, Ξ ® 1  11<, 16D
0.01541983224264333

- 0.009494629614989877

- 0.008679927388636600

0.1909584025500052

N@u@∆, L, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D


N@D@u@∆, L, ΞD, ∆D . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D
N@D@u@∆, L, ΞD, LD . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D
N@D@u@∆, L, ΞD, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  1000<, 16D
0.0001471408880498442

- 0.0001102915457626845

- 0.0001477088973243801

0.1477088973243801

N@u@∆, L, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D


N@D@u@∆, L, ΞD, ∆D . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D
N@D@u@∆, L, ΞD, LD . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D
N@D@u@∆, L, ΞD, ΞD . 8∆ ® 4, L ® 1, Ξ ® 1  100 000 000<, 16D

1.465742869555286 ´ 10-9

- 1.100290869880845 ´ 10-9

- 1.465742926075948 ´ 10-9

0.1465742926075948
HyperbolicTangent.nb 5

Limit@u@∆, L, ΞD, ∆ ® 0D . 8∆ ® 7, L ® 3, Ξ ® 1  9<


Limit@D@u@∆, L, ΞD, ∆D, ∆ ® 0D . 8∆ ® 7, L ® 3, Ξ ® 1  9<
Limit@D@u@∆, L, ΞD, LD, ∆ ® 0D . 8∆ ® 7, L ® 3, Ξ ® 1  9<
Limit@D@u@∆, L, ΞD, ΞD, ∆ ® 0D . 8∆ ® 7, L ® 3, Ξ ® 1  9<
1
27
0

1
-
81

1
3

A particular solution useful for checking solves for ∆ satisfying some conditions

Plot@u@6.7890123456789012, 2, ΞD, 8Ξ, 0, 2<D


7 890 123 456 789 012
NBuB6 + , 2, 1  2F, 16F
10 000 000 000 000 000
1.0

0.8

0.6

0.4

0.2

0.5 1.0 1.5 2.0

0.03141345703210717

Visualizing the one- and two-sided schemes

Comparing the two schemes on a non - unit domain


6 HyperbolicTangent.nb

Manipulate@Plot@8s@∆, 2, ΞD, u@∆, 2, ΞD<, 8Ξ, 0, 2<D, 88∆, 3<, 1  1000, 25<D

1.0

0.8

0.6

0.4

0.2

0.5 1.0 1.5 2.0

Comparing the scheme' s deviation from lthe limiting ∆® 0case

Manipulate@Plot@8
s@∆, L, ΞD - Ξ  L,
u@∆, L, ΞD - Ξ  L
<, 8Ξ, 0, L<D, 88∆, 1.<, 0, 10, 1  25<, 88L, 2<, 1, 10<D

1.0

0.8

0.6

0.4

0.2

0.5 1.0 1.5 2.0