https://github.com/sciml/boundaryvaluediffeq.jl
Boundary value problem (BVP) solvers for scientific machine learning (SciML)
https://github.com/sciml/boundaryvaluediffeq.jl
bvp differential-equations differentialequations gpu neural-bvp neural-differential-equations neural-ode scientific-machine-learning sciml
Last synced: 3 months ago
JSON representation
Boundary value problem (BVP) solvers for scientific machine learning (SciML)
- Host: GitHub
- URL: https://github.com/sciml/boundaryvaluediffeq.jl
- Owner: SciML
- License: other
- Created: 2017-03-23T22:16:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2026-04-23T02:59:32.000Z (3 months ago)
- Last Synced: 2026-04-23T03:25:29.159Z (3 months ago)
- Topics: bvp, differential-equations, differentialequations, gpu, neural-bvp, neural-differential-equations, neural-ode, scientific-machine-learning, sciml
- Language: Julia
- Homepage: https://docs.sciml.ai/BoundaryValueDiffEq/dev/
- Size: 7.67 MB
- Stars: 58
- Watchers: 8
- Forks: 42
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Citation: CITATION.bib
Awesome Lists containing this project
README
# BoundaryValueDiffEq
[](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
[](https://docs.sciml.ai/BoundaryValueDiffEq/dev/)
[](https://github.com/SciML/BoundaryValueDiffEq.jl/actions?query=workflow%3ACI)
[](https://codecov.io/gh/SciML/BoundaryValueDiffEq.jl)
[](https://pkgs.genieframework.com?packages=BoundaryValueDiffEq)
[](https://github.com/JuliaTesting/Aqua.jl)
[](https://github.com/SciML/ColPrac)
[](https://github.com/SciML/SciMLStyle)
BoundaryValueDiffEq.jl is a component package in the DifferentialEquations ecosystem. It holds the
boundary value problem solvers and utilities. While completely independent
and usable on its own, users interested in using this
functionality should check out [DifferentialEquations.jl](https://github.com/JuliaDiffEq/DifferentialEquations.jl).
## API
BoundaryValueDiffEq.jl is part of the SciML common interface, but can be used independently of DifferentialEquations.jl. The only requirement is that the user passes a BoundaryValueDiffEq.jl algorithm to solve. For example, we can solve the [BVP tutorial from the documentation](https://docs.sciml.ai/DiffEqDocs/stable/tutorials/bvp_example/) using the `MIRK4()` algorithm:
```julia
using BoundaryValueDiffEq
tspan = (0.0, pi / 2)
function simplependulum!(du, u, p, t)
θ = u[1]
dθ = u[2]
du[1] = dθ
du[2] = -9.81 * sin(θ)
end
function bc!(residual, u, p, t)
residual[1] = u(pi / 4)[1] + pi / 2
residual[2] = u(pi / 2)[1] - pi / 2
end
prob = BVProblem(simplependulum!, bc!, [pi / 2, pi / 2], tspan)
sol = solve(prob, MIRK4(), dt = 0.05)
```
## Available Solvers
For the list of available solvers, please refer to the [DifferentialEquations.jl BVP Solvers page](https://docs.sciml.ai/DiffEqDocs/stable/solvers/bvp_solve/). For options for the `solve` command, see the [common solver options page](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).
## Controlling Precompilation
Precompilation can be controlled via `Preferences.jl`
- `PrecompileMIRK` -- Precompile the MIRK2 - MIRK6 algorithms (default: `true`).
- `PrecompileShooting` -- Precompile the single shooting algorithms (default: `true`).
- `PrecompileMultipleShooting` -- Precompile the multiple shooting algorithms (default: `true`).
- `PrecompileMIRKNLLS` -- Precompile the MIRK2 - MIRK6 algorithms for under-determined and over-determined BVPs (default: `false`).
- `PrecompileShootingNLLS` -- Precompile the single shooting algorithms for under-determined and over-determined BVPs (default: `true`).
- `PrecompileMultipleShootingNLLS` -- Precompile the multiple shooting algorithms for under-determined and over-determined BVPs (default: `true` ).
To set these preferences before loading the package, do the following (replacing `PrecompileShooting` with the preference you want to set, or pass in multiple pairs to set them together):
```julia
using Preferences, UUIDs
Preferences.set_preferences!(UUID("764a87c0-6b3e-53db-9096-fe964310641d"), "PrecompileShooting" => false)
```
## Running Benchmarks Locally
We include a small set of benchmarks in the `benchmarks` folder. These are not extensive and mainly used to track regressions during development. For more extensive benchmarks, see the [SciMLBenchmarks](https://github.com/SciML/SciMLBenchmarks.jl) repository.
To run benchmarks locally install [AirspeedVelocity.jl](https://github.com/MilesCranmer/AirspeedVelocity.jl) and run the following command in the package directory:
```bash
benchpkg BoundaryValueDiffEq --rev="master," --bench-on="master"
```