Get Started
julia> using Pkg; Pkg.activate(\"PoliSpectralTools\")
julia> Pkg.instantiate()
julia> using PoliSpectralTools
julia> using PoliSpectralTools.Chebyshev, PoliSpectralTools.BVP
Feature Highlights
- Collocation: `Collocation.build_grid(N; basis, domain)` returns Lobatto grids with scaled `D₁`, `D₂`.
- BVP solvers: `solve_linear_bvp` and `solve_nonlinear_bvp` handle Dirichlet/Neumann/Robin conditions.
- PDE stack: Diffusion (RK4), wave (leapfrog), and 2D Poisson (Kronecker) solvers.
- Reusable utilities: Barycentric interpolation and spectral transforms for Chebyshev, Legendre, Fourier bases.
Example Showcase
Diffusion decay example generated by examples/diffusion.jl comparing RK4 with the analytic solution.
Animation showing the mode decaying over time.
Standing-wave snapshot showing the solver’s ability to enforce mixed boundary conditions.
Animation of the standing mode oscillation.
Manufactured Poisson solution on a square domain, solved via the Kronecker approach.
Rotating view of the Poisson surface.
API Cheatsheet
| Function | Description | When to Use |
|---|---|---|
solve_linear_bvp(a,b,c,rhs; ...) | Second-order linear ODE with Lobatto nodes. | Variable-coefficient problems on 1D intervals. |
solve_nonlinear_bvp(g; ...) | Newton iteration for y'' = g(x,y,y'). | Nonlinear steady states; supply derivatives if available. |
solve_diffusion_1d(u0,tspan; ...) | MOL + RK4 with optional forcing. | Parabolic PDEs requiring high spatial accuracy. |
solve_wave_1d(u0,v0,tspan; ...) | Leapfrog scheme enforcing mixed BCs. | 1D acoustics / string dynamics with CFL control. |
solve_poisson_2d(f; ...) | Kronecker solve on tensor-product grids. | Manufactured solutions, electrostatics on rectangles. |
Example & Test Progress
| # | Scenario | Status |
|---|---|---|
| 1 | Chebyshev linear BVP | Ready |
| 2 | Diffusion decay | Ready |
| 3 | Legendre linear BVP | Ready |
| 4 | Nonlinear BVP Newton | Ready |
| 5 | Wave mixed BCs | Ready |
| 6 | Traveling pulse wave | In progress |
| 7 | Forced diffusion | In progress |
| 8 | Poisson square | In progress |
| 9 | Poisson rectangular domain | In progress |
| 10 | Mapping-enhanced solver | In progress |
See EXAMPLES_TEST_PLAN.md or the detailed example guide for definitions.
Contribute
Run include(\"test/runtests.jl\") before opening a PR. Implement missing examples/tests and drop additional images in docs/assets/ to enrich this page.