You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linear operators between two spaces in ApproxFun are represented by subtypes of `Operator`. Every operator has a `domainspace` and `rangespace`. That is, if a `Fun``f` has the space `domainspace(op)`, then`op*f` is a `Fun` with space `rangespace(op)`.
12
+
Linear operators between two spaces in ApproxFun are represented by subtypes of `Operator`. Every operator has a `domainspace` and `rangespace`. That is, if a `Fun``f` has the space `domainspace(op)`, then`op * f` is a `Fun` with space `rangespace(op)`.
10
13
11
14
Note that the size of an operator is specified by the dimension of the domain and range space.
12
15
@@ -15,23 +18,11 @@ Note that the size of an operator is specified by the dimension of the domain an
15
18
Differential and integral operators are perhaps the most useful type of operators in mathematics. Consider the derivative operator on `CosSpace`:
@@ -100,11 +77,7 @@ As can be seen from the output, `rangespace(B)` is a `ConstantSpace(Point(0))`,
100
77
Closely related to functionals are operators with finite-dimensional range. For example, the `Dirichlet` operator represents the restriction of a space to its boundary. In the case, of `Chebyshev()`, this amounts to evaluation at the endpoints `±1`:
When the domain and range space are not the same, the identity operator becomes a conversion operator. That is, to represent `D+I` acting on the Chebyshev space, we would do the following:
julia> C = Conversion(Chebyshev(), Ultraspherical(1));
159
+
160
+
julia> (D + C) * f ≈ Fun(x->x^3 + 3x^2)
256
161
true
257
162
```
258
163
@@ -275,52 +180,31 @@ julia> L = I + exp(x)*Σ;
275
180
276
181
julia> u = cos(10x^2);
277
182
278
-
julia> (L*u)(0.1) ≈ u(0.1) + exp(0.1)*sum(u)
183
+
julia> (L * u)(0.1) ≈ u(0.1) + exp(0.1) * sum(u)
279
184
true
280
185
```
281
186
282
-
Note that `DefiniteIntegral` is a functional, i.e., a 1 × ∞ operator. when multiplied on the left by a function, it automatically constructs the operator ``\mathop{e}^x \int_{-1}^1 \mathop{f}(x) \mathop{dx}`` via
187
+
Note that `DefiniteIntegral` is a functional, i.e., a 1 × ∞ operator. when multiplied on the left by a function, it automatically constructs the operator ``\mathrm{L}=\mathop{e}^x \int_{-1}^1 \mathop{f}(x) \mathop{dx}`` via
julia> L * Fun(x->3x^2/2, Chebyshev()) ≈ Fun(exp, Chebyshev())
199
+
true
316
200
```
317
201
318
202
!!! note
319
-
`Σ*exp(x)` applies the operator to a function. To construct the operator that first multiplies by `exp(x)`, use `Σ[exp(x)]`. This is equivalent to `Σ*Multiplication(exp(x),Chebyshev())`.
203
+
`Σ * exp(x)` applies the operator to a function. To construct the operator that first multiplies by `exp(x)`, use `Σ[exp(x)]`. This is equivalent to `Σ * Multiplication(exp(x))`.
320
204
321
205
## Operators and space promotion
322
206
323
-
It is often more convenient to not specify a space explicitly, but rather infer it when the operator is used. For example, we can construct `Derivative()`, which has the alias `𝒟`, and represents the first derivative on any space:
207
+
It is often more convenient to not specify a space explicitly, but rather infer it when the operator is used. For example, we can construct `Derivative()`, which has the alias `𝒟` (typed as `\scrD<tab>`), and represents the first derivative on any space:
324
208
325
209
```jldoctest
326
210
julia> f = Fun(cos, Chebyshev(0..1));
@@ -330,30 +214,17 @@ true
330
214
331
215
julia> f = Fun(cos, Fourier());
332
216
333
-
julia> (𝒟*f)(0.1) ≈ -sin(0.1)
217
+
julia> (𝒟 * f)(0.1) ≈ -sin(0.1)
334
218
true
335
219
```
336
220
337
-
Behind the scenes, `Derivative()` is equivalent to `Derivative(UnsetSpace(),1)`. When multiplying a function `f`, the domain space is promoted before multiplying, that is, `Derivative()*f` is equivalent to `Derivative(space(f))*f`.
221
+
Behind the scenes, `Derivative()` is equivalent to `Derivative(UnsetSpace(),1)`. When multiplying a function `f`, the domain space is promoted before multiplying, that is, `Derivative() * f` is equivalent to `Derivative(space(f)) * f`.
338
222
339
223
This promotion of the domain space happens even when operators have spaces attached. This facilitates the following construction:
Note that `rangespace(D) ≠ Chebyshev()`, hence the operators are not compatible. Therefore, it has thrown away its domain space, and thus this is equivalent to `Derivative(rangespace(D))*D`.
0 commit comments