Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unicode in README comments #12

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,35 @@ This package supports computing singular integrals involving Hilbert/Stieltjes/C
log, and power law kernels.

Some examples:

```julia
julia> using SingularIntegrals, ClassicalOrthogonalPolynomials

julia> P = Legendre(); x = axes(P,1); f = expand(P, exp); # expand exp(x) in Legendre polynomials
julia> P = Legendre(); x = axes(P, 1); f = expand(P, exp); # expand exp(x) in Legendre polynomials

julia> @time inv.(10 .- x') * f # Stieltjes: ∫_{-1}^1 exp(x)/(10-x) dx
julia> @time inv.(10 .- x') * f # Stieltjes: ∫₋₁¹ exp(x) / (10-x) dx
0.000034 seconds (22 allocations: 2.266 KiB)
0.24332755428373515

julia> @time inv.(0.1+0im .- x') * f - inv.(0.1-0im .- x') * f ≈ -2π*im*exp(0.1) # example of Plemelj
0.000052 seconds (49 allocations: 6.031 KiB)
true

julia> @time abs.(10 .- x') .^ 0.2 * f # Power law: ∫_{-1}^1 (10-x)^0.2 * exp(x) dx
julia> @time abs.(10 .- x') .^ 0.2 * f # Power law: ∫₋₁¹ (10-x)^0.2 * exp(x) dx
0.000077 seconds (21 allocations: 1.875 KiB)
3.7006631248289135

julia> @time abs.(0.3 .- x') .^ 0.2 * f # ∫_{-1}^1 abs(0.3-x)^0.2 * exp(x) dx
julia> @time abs.(0.3 .- x') .^ 0.2 * f # ∫₋₁¹ abs(0.3-x)^0.2 * exp(x) dx
0.000040 seconds (25 allocations: 2.172 KiB)
1.9044201526740234

julia> W = Weighted(ChebyshevU()); f = expand(W, x -> exp(x) * sqrt(1-x^2));

julia> @time log.(abs.(10 .- x')) * f # Log-kernel: ∫_{-1}^1 log(10-x) * exp(x) * sqrt(1-x^2) dx
julia> @time log.(abs.(10 .- x')) * f # Log-kernel: ∫₋₁¹ log(10-x) * exp(x) * sqrt(1-x^2) dx
0.000040 seconds (14 allocations: 400 bytes)
4.043032838853287

julia> @time log.(abs.(0.3 .- x')) * f # ∫_{-1}^1 log(abs(0.3-x)) * exp(x) * sqrt(1-x^2) dx
julia> @time log.(abs.(0.3 .- x')) * f # ∫₋₁¹ log(abs(0.3-x)) * exp(x) * sqrt(1-x^2) dx
0.000035 seconds (116 allocations: 6.250 KiB)
-2.320391559008445
```