Skip to content

Commit

Permalink
Update docs, bump REQUIRE
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed Aug 15, 2018
1 parent 3936eec commit f6b36ac
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 170 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ base functions are overridden for the purposes of calculus. Because the exponent
derivative, the `norm` is small:

```julia
f = Fun(x->exp(x),-1..1)
f = Fun(x->exp(x), -1..1)
norm(f-f')
```

Expand Down Expand Up @@ -81,12 +81,12 @@ h = airyai(10asin(f)+2g)
Solve the Airy ODE `u'' - x u = 0` as a BVP on `[-1000,200]`:

```julia
x = Fun(identity,-1000..200)
x = Fun(identity, -1000..200)
d = domain(x)
D = Derivative(d)
B = Dirichlet(d)
L = D^2 - x
u = [B;L] \ [[airyai(d.a),airyai(d.b)],0]
u = [B;L] \ [[airyai(d.a), airyai(d.b)], 0]
plot(u)
```

Expand All @@ -98,11 +98,11 @@ plot(u)
Solve a nonlinear boundary value problem satisfying the ODE `0.001u'' + 6*(1-x^2)*u' + u^2 = 1` with boundary conditions `u(-1)==1`, `u(1)==-0.5` on `[-1,1]`:

```julia
x=Fun()
u0=0.0x
x = Fun()
u₀ = 0.0x

N=u->[u(-1)-1,u(1)+0.5,0.001u''+6*(1-x^2)*u'+u^2-1]
u=newton(N,u0)
N = u -> [u(-1)-1, u(1)+0.5, 0.001u'' + 6*(1-x^2)*u' + u^2 - 1]
u = newton(N,u0)
plot(u)
```

Expand All @@ -117,8 +117,8 @@ There is also support for Fourier representations of functions on periodic inter
Specify the space `Fourier` to ensure that the representation is periodic:

```julia
f = Fun(cos,Fourier(-π..π))
norm(f' + Fun(sin,Fourier(-π..π))
f = Fun(cos, Fourier(-π..π))
norm(f' + Fun(sin, Fourier(-π..π))
```
Due to the periodicity, Fourier representations allow for the asymptotic savings of `2/π`
Expand All @@ -127,16 +127,16 @@ ODEs can also be solved when the solution is periodic:
```julia
s = Chebyshev(-π..π)
a = Fun(t-> 1+sin(cos(2t)),s)
a = Fun(t-> 1+sin(cos(2t)), s)
L = Derivative() + a
f = Fun(t->exp(sin(10t)),s)
f = Fun(t->exp(sin(10t)), s)
B = periodic(s,0)
uChebyshev = [B;L]\[0.;f]
uChebyshev = [B;L] \ [0.;f]

s = Fourier(-π..π)
a = Fun(t-> 1+sin(cos(2t)),s)
a = Fun(t-> 1+sin(cos(2t)), s)
L = Derivative() + a
f = Fun(t->exp(sin(10t)),s)
f = Fun(t->exp(sin(10t)), s)
uFourier = L\f

ncoefficients(uFourier)/ncoefficients(uChebyshev),2/π
Expand All @@ -154,7 +154,7 @@ Other operations including random number sampling using [Olver & Townsend 2013].
following code samples 10,000 from a PDF given as the absolute value of the sine function on `[-5,5]`:
```julia
f = abs(Fun(sin,-5..5))
f = abs(Fun(sin, -5..5))
x = ApproxFun.sample(f,10000)
histogram(x;normed=true)
plot!(f/sum(f))
Expand All @@ -175,7 +175,7 @@ completely.
d = Interval()^2 # Defines a rectangle
Δ = Laplacian(d) # Represent the Laplacian
f = ones((d)) # one at the boundary
u = \([Dirichlet(d);Δ+100I],[f;0.]; # Solve the PDE
u = \([Dirichlet(d); Δ+100I], [f;0.]; # Solve the PDE
tolerance=1E-5)
surface(u) # Surface plot
```
Expand Down Expand Up @@ -203,9 +203,9 @@ Solving differential equations with high precision types is available. The foll
```julia
setprecision(1000) do
d=BigFloat(0)..BigFloat(1)
D=Derivative(d)
u=[ldirichlet();D-I]\[1;0]
d = BigFloat(0)..BigFloat(1)
D = Derivative(d)
u = [ldirichlet(); D-I] \ [1; 0]
@test u(1) exp(BigFloat(1))
end
```
Expand Down
22 changes: 11 additions & 11 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
julia 0.7
FastGaussQuadrature 0.2.1
FastGaussQuadrature 0.3.2
FastTransforms 0.4.1
RecipesBase 0.1
DualNumbers 0.2.2
BandedMatrices 0.4
ToeplitzMatrices 0.2
RecipesBase 0.5
DualNumbers 0.4
BandedMatrices 0.5.1
ToeplitzMatrices 0.4
Calculus 0.1.15
IntervalSets 0.0.2
StaticArrays 0.3
BlockArrays 0.3.1
IntervalSets 0.2
StaticArrays 0.8.3
BlockArrays 0.4.1
BlockBandedMatrices 0.1
AbstractFFTs 0.3.1
FFTW 0.0.4
SpecialFunctions 0.6
LowRankApprox 0.1.3
FFTW 0.2.4
SpecialFunctions 0.7
LowRankApprox 0.1.4
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ makedocs(modules=[ApproxFun],
deploydocs(
repo = "github.com/JuliaApproximation/ApproxFun.jl.git",
latest = "development",
julia = "0.6",
julia = "0.7",
osname = "linux",
target = "build",
deps = nothing,
Expand Down
6 changes: 1 addition & 5 deletions docs/src/internals/multivariate.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A `Fun` is only one possible way to represent a bivariate function. This mirror
Another format for representing bivariate functions in ApproxFun is a `ProductFun`: for example, the previous function could also be represented by

```julia
f=ProductFun((x,y)->exp(-x^2-y^2),Interval()^2)
f = ProductFun((x,y)->exp(-x^2-y^2),Interval()^2)
```

A `ProductFun` also has two fields: `f.coefficients` and `f.space`, where `f.space` must be an `AbstractProductSpace`. Here, `f.coefficients` is a `Vector{Fun{S,T}}` that represents a list of functions in `x`, where
Expand All @@ -41,10 +41,6 @@ A `ProductFun` also has two fields: `f.coefficients` and `f.space`, where `f.spa
space(f.coefficients[k]) == columnspace(f.space,k)
```





## LowRankFun

`LowRankFun`
Expand Down
20 changes: 10 additions & 10 deletions docs/src/usage/constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ Chebyshev(【-1.0,-0.9000000000000002】)⨄Chebyshev(【-0.9000000000000002,-0.
The default space is `Chebyshev`, which can represent non-periodic functions on intervals. Each `Space` type has a default domain: for `Chebyshev` this is `-1..1`, for Fourier and Laurent this is `-π..π`. Thus the following
are synonyms:
```julia
Fun(exp,Chebyshev(Interval(-1,1)))
Fun(exp,Chebyshev(Interval()))
Fun(exp,Chebyshev(-1..1))
Fun(exp,Chebyshev())
Fun(exp,-1..1)
Fun(exp,Interval())
Fun(exp,Interval(-1,1))
Fun(exp, Chebyshev(Interval(-1,1)))
Fun(exp, Chebyshev(Interval()))
Fun(exp, Chebyshev(-1..1))
Fun(exp, Chebyshev())
Fun(exp, -1..1)
Fun(exp, Interval())
Fun(exp, Interval(-1,1))
Fun(exp)
```
If a function is not specified, then it is taken to be `identity`. Thus we have the
following synonyms:
```julia
x = Fun(identity,-1..1)
x = Fun(identity, -1..1)
x = Fun(-1..1)
x = Fun(identity)
x = Fun()
Expand All @@ -70,12 +70,12 @@ x = Fun()
It is sometimes necessary to specify coefficients explicitly. This is possible
via specifying the space followed by a vector of coefficients:
```jldoctest
julia> f = Fun(Taylor(),[1,2,3]); # represents 1 + 2z + 3z^2
julia> f = Fun(Taylor(), [1,2,3]); # represents 1 + 2z + 3z^2
julia> f(0.1)
1.23
julia> 1+2*0.1+3*0.1^2
julia> 1 + 2*0.1 + 3*0.1^2
1.23
```

Expand Down
8 changes: 4 additions & 4 deletions docs/src/usage/equations.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ $$u + {\rm e}^x \int_{-1}^1 \cos x \, u(x) {\rm d}x = \cos {\rm e}^x$$

We can solve this equation as follows:
```jldoctest
julia> Σ = DefiniteIntegral(Chebyshev()); x=Fun();
julia> Σ = DefiniteIntegral(Chebyshev()); x = Fun();
julia> u = (I+exp(x)*Σ[cos(x)])\cos(exp(x));
julia> u = (I+exp(x)*Σ[cos(x)]) \ cos(exp(x));
julia> u(0.1)
0.21864294855628802
Expand Down Expand Up @@ -193,7 +193,7 @@ g = exp.(-10(x+0.2)^2-20(y-0.1)^2)
Many PDEs have weak singularities at the corners, in which case it is beneficial to
specify a tolerance to reduce the time:
```julia
\(A,[zeros((d));f]; tolerance=1E-6)
\(A, [zeros((d));f]; tolerance=1E-6)
```


Expand All @@ -210,6 +210,6 @@ $$\begin{align*}
This can be solved using
```julia
x = Fun()
N = u->[u(-1.)-c;u(1.);ε*u''+6*(1-x^2)*u'+u^2-1.]
N = u -> [u(-1.)-c; u(1.); ε*u'' + 6*(1-x^2)*u' + u^2 - 1.0]
u = newton(N,u0)
```
Loading

0 comments on commit f6b36ac

Please sign in to comment.