1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Ordinary differential equation (ODE) solvers.
//!
//! This module provides types for configuring ODE solvers. The actual
//! implementations use tensor operations and are available via the
//! [`IntegrationAlgorithms`](crate::integrate::IntegrationAlgorithms) trait.
//!
//! # Available Methods
//!
//! ## Explicit Methods (Non-Stiff Problems)
//!
//! | Method | Order | Best For |
//! |--------|-------|----------|
//! | RK23 | 2(3) | Low accuracy, fast |
//! | RK45 | 4(5) | General purpose (default) |
//! | DOP853 | 8(5,3) | High accuracy |
//!
//! ## Implicit Methods (Stiff Problems)
//!
//! | Method | Order | Best For |
//! |--------|-------|----------|
//! | BDF | 1-5 | Stiff problems, chemical kinetics |
//! | Radau | 5 | Very stiff problems |
//! | LSODA | auto | Unknown stiffness |
//!
//! ## Symplectic Methods (Hamiltonian Systems)
//!
//! | Method | Order | Best For |
//! |--------|-------|----------|
//! | Verlet | 2 | Molecular dynamics |
//! | Leapfrog | 2 | N-body simulations |
//!
//! # Usage
//!
//! Use the `solve_ivp` method on a client implementing `IntegrationAlgorithms`:
//!
//! ```
//! # use numr::runtime::cpu::{CpuClient, CpuDevice};
//! # use numr::tensor::Tensor;
//! # use numr::ops::ScalarOps;
//! use solvr::integrate::{IntegrationAlgorithms, ODEOptions};
//! # let device = CpuDevice::new();
//! # let client = CpuClient::new(device.clone());
//! // Solve dy/dt = -y, y(0) = 1
//! # let y0 = Tensor::from_slice(&[1.0], &[1], &device);
//! let result = client.solve_ivp(
//! |_t, y| Ok(client.mul_scalar(y, -1.0)?),
//! [0.0, 5.0],
//! &y0,
//! &ODEOptions::default(),
//! )?;
//! // y(5) ≈ exp(-5) ≈ 0.00674
//! # let y_final = result.y_final_vec();
//! # assert!((y_final[0] - (-5.0_f64).exp()).abs() < 1e-3);
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub use ;
pub use DirectSolverConfig;
pub use SparseSolverStrategy;