Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chris00/rust-sundials
High level bindings to the Sundials library for Rust
https://github.com/chris00/rust-sundials
Last synced: 15 days ago
JSON representation
High level bindings to the Sundials library for Rust
- Host: GitHub
- URL: https://github.com/chris00/rust-sundials
- Owner: Chris00
- License: bsd-3-clause
- Created: 2022-05-24T21:16:59.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T15:21:18.000Z (7 months ago)
- Last Synced: 2024-05-09T23:22:10.445Z (6 months ago)
- Language: Rust
- Size: 74.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Rust Sundials
=============[Sundials][] is a s̲u̲ite of n̲onlinear and d̲i̲fferential/a̲l̲gebraic
equation s̲olvers.# Example
The following code solves the equation ∂ₜu = f(t,u) where f is the
function (t,u) ↦ 1 using Adams' method.```rust
use sundials::{context, cvode::CVode};
fn main() -> Result<(), Box> {
let mut ode = CVode::adams(0., &[0.], |t, u, du| *du = [1.])
.build(context!()?)?;
let mut u1 = [f64::NAN];
ode.solve(2., &mut u1);
assert_eq!(u1, [2.]);
let (u2, _) = ode.cauchy(0., &[0.], 1.);
assert_eq!(u2[0], 1.);
Ok(())
}
```Then `u[0]` contains the solution u at time t=1 and `u[1]` the
speed ∂ₜu(1).[Sundials]: https://computing.llnl.gov/projects/sundials