diff --git a/README.md b/README.md index 020e90a1..911e1ef7 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ The example code demonstrates how Peroxide can be used to simulate the Lorenz at use peroxide::fuga::*; fn main() -> Result<(), Box> { - let rkf45 = RKF45::new(1e-4, 0.9, 1e-6, 1e-1, 100); + let rkf45 = RKF45::new(1e-4, 0.9, 1e-6, 1e-2, 100); let basic_ode_solver = BasicODESolver::new(rkf45); let (_, y_vec) = basic_ode_solver.solve( &Lorenz, diff --git a/example_data/lorenz_rkf45.png b/example_data/lorenz_rkf45.png index fe7f21b1..494bea7d 100644 Binary files a/example_data/lorenz_rkf45.png and b/example_data/lorenz_rkf45.png differ diff --git a/example_data/rkf45_test.png b/example_data/rkf45_test.png index 905521fb..6191ce2a 100644 Binary files a/example_data/rkf45_test.png and b/example_data/rkf45_test.png differ diff --git a/example_data/test_plot.png b/example_data/test_plot.png index d1a10cb8..96bb5ba3 100644 Binary files a/example_data/test_plot.png and b/example_data/test_plot.png differ diff --git a/examples/lorenz_rkf45.rs b/examples/lorenz_rkf45.rs index 98c3ca65..83e2bdac 100644 --- a/examples/lorenz_rkf45.rs +++ b/examples/lorenz_rkf45.rs @@ -2,7 +2,7 @@ use peroxide::fuga::*; #[allow(unused_variables)] fn main() -> Result<(), Box> { - let rkf45 = RKF45::new(1e-4, 0.9, 1e-6, 1e-1, 100); + let rkf45 = RKF45::new(1e-4, 0.9, 1e-6, 1e-2, 100); let basic_ode_solver = BasicODESolver::new(rkf45); let (_, y_vec) = basic_ode_solver.solve( &Lorenz, diff --git a/src/util/plot.rs b/src/util/plot.rs index ce020993..de32b46a 100644 --- a/src/util/plot.rs +++ b/src/util/plot.rs @@ -21,8 +21,9 @@ //! let y1 = x.fmap(|t| t.powi(2)); //! let y2 = x.fmap(|t| t.powi(3)); //! +//! let mut rng = SmallRng::seed_from_u64(42); //! let normal = Normal(0f64, 0.1); -//! let eps = normal.sample(100); +//! let eps = normal.sample_with_rng(&mut rng, x.len()); //! let y3 = y2.add_v(&eps); //! //! let mut plt = Plot2D::new();