Added a prelude
This commit is contained in:
@@ -34,10 +34,7 @@ For now, here is a simple example of using the propagator to solve a simple syst
|
|||||||
|
|
||||||
```rust
|
```rust
|
||||||
use nalgebra::Vector3;
|
use nalgebra::Vector3;
|
||||||
use differential_equations::integrator::dormand_prince::DormandPrince45;
|
use differential_equations::prelude::*;
|
||||||
use differential_equations::controller::PIController;
|
|
||||||
use differential_equations::callback::stop;
|
|
||||||
use differential_equations::problem::*;
|
|
||||||
|
|
||||||
// Define the system (parameters, derivative, and initial state)
|
// Define the system (parameters, derivative, and initial state)
|
||||||
type Params = (f64, bool);
|
type Params = (f64, bool);
|
||||||
|
|||||||
13
src/lib.rs
13
src/lib.rs
@@ -6,16 +6,19 @@ pub mod controller;
|
|||||||
pub mod callback;
|
pub mod callback;
|
||||||
pub mod problem;
|
pub mod problem;
|
||||||
|
|
||||||
|
pub mod prelude {
|
||||||
|
pub use super::ode::ODE;
|
||||||
|
pub use super::integrator::dormand_prince::DormandPrince45;
|
||||||
|
pub use super::controller::PIController;
|
||||||
|
pub use super::callback::{Callback, stop};
|
||||||
|
pub use super::problem::{Problem, Solution};
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use nalgebra::{Vector3, Vector6};
|
use nalgebra::{Vector3, Vector6};
|
||||||
use approx::assert_relative_eq;
|
use approx::assert_relative_eq;
|
||||||
use crate::integrator::dormand_prince::DormandPrince45;
|
use crate::prelude::*;
|
||||||
use crate::controller::PIController;
|
|
||||||
use crate::callback::{Callback, stop};
|
|
||||||
use crate::ode::ODE;
|
|
||||||
use crate::problem::Problem;
|
|
||||||
use std::f64::consts::PI;
|
use std::f64::consts::PI;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user