Skip to content

Commit 7376381

Browse files
fix docs
1 parent fcc3833 commit 7376381

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/src/tutorials/fftw.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ L = 2π
1616
1717
dx = L / n
1818
x = range(start = -L / 2, stop = L / 2 - dx, length = n) |> Array
19-
u = @. sin(5x)cos(7x);
20-
du = @. 5cos(5x)cos(7x) - 7sin(5x)sin(7x);
19+
v = @. sin(5x)cos(7x);
20+
w = @. 5cos(5x)cos(7x) - 7sin(5x)sin(7x);
2121
2222
k = rfftfreq(n, 2π * n / L) |> Array
2323
m = length(k)
@@ -38,10 +38,10 @@ F = FunctionOperator(fwd, x, im * k;
3838
ik = im * DiagonalOperator(k)
3939
Dx = F \ ik * F
4040
41-
Dx = cache_operator(Dx, x)
41+
Dx = cache_operator(Dx, v)
4242
43-
@show ≈(Dx * u, du; atol = 1e-8)
44-
@show ≈(mul!(copy(u), Dx, u), du; atol = 1e-8)
43+
@show ≈(Dx * v, w; atol = 1e-8)
44+
@show ≈(mul!(copy(w), Dx, v), w; atol = 1e-8)
4545
```
4646

4747
## Explanation
@@ -61,8 +61,8 @@ n = 256
6161
dx = L / n
6262
x = range(start = -L / 2, stop = L / 2 - dx, length = n) |> Array
6363
64-
u = @. sin(5x)cos(7x);
65-
du = @. 5cos(5x)cos(7x) - 7sin(5x)sin(7x);
64+
v = @. sin(5x)cos(7x);
65+
w = @. 5cos(5x)cos(7x) - 7sin(5x)sin(7x);
6666
```
6767

6868
Now, we define the Fourier transform. Since our input is purely Real, we use the real
@@ -87,7 +87,7 @@ fwd(v, u, p, t) = P * v
8787
bwd(v, u, p, t) = P \ v
8888
8989
fwd(w, v, u, p, t) = mul!(w, P, v)
90-
bwd(w, v, p, t) = ldiv!(w, P, v)
90+
bwd(w, v, u, p, t) = ldiv!(w, P, v)
9191
F = FunctionOperator(fwd, x, im * k;
9292
T = ComplexF64, op_adjoint = bwd,
9393
op_inverse = bwd,
@@ -106,6 +106,6 @@ Dx = F \ ik * F
106106
107107
Dx = cache_operator(Dx, x)
108108
109-
@show ≈(Dx * u, du; atol = 1e-8)
110-
@show ≈(mul!(copy(u), Dx, u), du; atol = 1e-8)
109+
@show ≈(Dx * v, w; atol = 1e-8)
110+
@show ≈(mul!(copy(w), Dx, v), w; atol = 1e-8)
111111
```

0 commit comments

Comments
 (0)