|
1 |
| -use crate::StrError; |
2 | 1 | use crate::{NoArgs, PdeDiscreteLaplacian2d, Side, System};
|
3 | 2 | use russell_lab::math::PI;
|
4 | 3 | use russell_lab::Vector;
|
@@ -42,7 +41,7 @@ impl Samples {
|
42 | 41 | /// * `args` -- is a placeholder variable with the arguments to F and J
|
43 | 42 | /// * `y_fn_x` -- is a function to compute the analytical solution
|
44 | 43 | pub fn simple_equation_constant<'a>() -> (
|
45 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
| 44 | + System<'a, NoArgs>, |
46 | 45 | f64,
|
47 | 46 | Vector,
|
48 | 47 | NoArgs,
|
@@ -153,7 +152,7 @@ impl Samples {
|
153 | 152 | symmetric: bool,
|
154 | 153 | genie: Genie,
|
155 | 154 | ) -> (
|
156 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
| 155 | + System<'a, NoArgs>, |
157 | 156 | f64,
|
158 | 157 | Vector,
|
159 | 158 | NoArgs,
|
@@ -257,13 +256,7 @@ impl Samples {
|
257 | 256 | /// * Hairer E, Nørsett, SP, Wanner G (2008) Solving Ordinary Differential Equations I.
|
258 | 257 | /// Non-stiff Problems. Second Revised Edition. Corrected 3rd printing 2008. Springer Series
|
259 | 258 | /// in Computational Mathematics, 528p
|
260 |
| - pub fn brusselator_ode<'a>() -> ( |
261 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
262 |
| - f64, |
263 |
| - Vector, |
264 |
| - NoArgs, |
265 |
| - Vector, |
266 |
| - ) { |
| 259 | + pub fn brusselator_ode<'a>() -> (System<'a, NoArgs>, f64, Vector, NoArgs, Vector) { |
267 | 260 | // system
|
268 | 261 | let ndim = 2;
|
269 | 262 | let jac_nnz = 4;
|
@@ -502,16 +495,7 @@ impl Samples {
|
502 | 495 | npoint: usize,
|
503 | 496 | second_book: bool,
|
504 | 497 | ignore_diffusion: bool,
|
505 |
| - ) -> ( |
506 |
| - System< |
507 |
| - 'a, |
508 |
| - impl Fn(&mut Vector, f64, &Vector, &mut PdeDiscreteLaplacian2d) -> Result<(), StrError>, |
509 |
| - PdeDiscreteLaplacian2d, |
510 |
| - >, |
511 |
| - f64, |
512 |
| - Vector, |
513 |
| - PdeDiscreteLaplacian2d, |
514 |
| - ) { |
| 498 | + ) -> (System<'a, PdeDiscreteLaplacian2d>, f64, Vector, PdeDiscreteLaplacian2d) { |
515 | 499 | // constants
|
516 | 500 | let (kx, ky) = (alpha, alpha);
|
517 | 501 | let (xmin, xmax) = (0.0, 1.0);
|
@@ -663,14 +647,7 @@ impl Samples {
|
663 | 647 | /// * Hairer E, Nørsett, SP, Wanner G (2008) Solving Ordinary Differential Equations I.
|
664 | 648 | /// Non-stiff Problems. Second Revised Edition. Corrected 3rd printing 2008. Springer Series
|
665 | 649 | /// in Computational Mathematics, 528p
|
666 |
| - pub fn arenstorf<'a>() -> ( |
667 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
668 |
| - f64, |
669 |
| - Vector, |
670 |
| - f64, |
671 |
| - NoArgs, |
672 |
| - Vector, |
673 |
| - ) { |
| 650 | + pub fn arenstorf<'a>() -> (System<'a, NoArgs>, f64, Vector, f64, NoArgs, Vector) { |
674 | 651 | // constants
|
675 | 652 | const MU: f64 = 0.012277471;
|
676 | 653 | const MD: f64 = 1.0 - MU;
|
@@ -788,7 +765,7 @@ impl Samples {
|
788 | 765 | /// Stiff and Differential-Algebraic Problems. Second Revised Edition.
|
789 | 766 | /// Corrected 2nd printing 2002. Springer Series in Computational Mathematics, 614p
|
790 | 767 | pub fn hairer_wanner_eq1<'a>() -> (
|
791 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
| 768 | + System<'a, NoArgs>, |
792 | 769 | f64,
|
793 | 770 | Vector,
|
794 | 771 | NoArgs,
|
@@ -861,12 +838,7 @@ impl Samples {
|
861 | 838 | /// * Hairer E, Wanner G (2002) Solving Ordinary Differential Equations II.
|
862 | 839 | /// Stiff and Differential-Algebraic Problems. Second Revised Edition.
|
863 | 840 | /// Corrected 2nd printing 2002. Springer Series in Computational Mathematics, 614p
|
864 |
| - pub fn robertson<'a>() -> ( |
865 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
866 |
| - f64, |
867 |
| - Vector, |
868 |
| - NoArgs, |
869 |
| - ) { |
| 841 | + pub fn robertson<'a>() -> (System<'a, NoArgs>, f64, Vector, NoArgs) { |
870 | 842 | // system
|
871 | 843 | let ndim = 3;
|
872 | 844 | let mut system = System::new(ndim, |f: &mut Vector, _x: f64, y: &Vector, _args: &mut NoArgs| {
|
@@ -942,16 +914,7 @@ impl Samples {
|
942 | 914 | /// * Hairer E, Wanner G (2002) Solving Ordinary Differential Equations II.
|
943 | 915 | /// Stiff and Differential-Algebraic Problems. Second Revised Edition.
|
944 | 916 | /// Corrected 2nd printing 2002. Springer Series in Computational Mathematics, 614p
|
945 |
| - pub fn van_der_pol<'a>( |
946 |
| - epsilon: f64, |
947 |
| - stationary: bool, |
948 |
| - ) -> ( |
949 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
950 |
| - f64, |
951 |
| - Vector, |
952 |
| - f64, |
953 |
| - NoArgs, |
954 |
| - ) { |
| 917 | + pub fn van_der_pol<'a>(epsilon: f64, stationary: bool) -> (System<'a, NoArgs>, f64, Vector, f64, NoArgs) { |
955 | 918 | // constants
|
956 | 919 | let x0 = 0.0;
|
957 | 920 | let mut y0 = Vector::from(&[2.0, -0.6]);
|
@@ -1071,12 +1034,7 @@ impl Samples {
|
1071 | 1034 | /// * Hairer E, Wanner G (2002) Solving Ordinary Differential Equations II.
|
1072 | 1035 | /// Stiff and Differential-Algebraic Problems. Second Revised Edition.
|
1073 | 1036 | /// Corrected 2nd printing 2002. Springer Series in Computational Mathematics, 614p
|
1074 |
| - pub fn amplifier1t<'a>() -> ( |
1075 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
1076 |
| - f64, |
1077 |
| - Vector, |
1078 |
| - NoArgs, |
1079 |
| - ) { |
| 1037 | + pub fn amplifier1t<'a>() -> (System<'a, NoArgs>, f64, Vector, NoArgs) { |
1080 | 1038 | // constants
|
1081 | 1039 | const ALPHA: f64 = 0.99;
|
1082 | 1040 | const GAMMA: f64 = 1.0 - ALPHA;
|
@@ -1174,7 +1132,7 @@ impl Samples {
|
1174 | 1132 | /// * Kreyszig, E (2011) Advanced engineering mathematics; in collaboration with Kreyszig H,
|
1175 | 1133 | /// Edward JN 10th ed 2011, Hoboken, New Jersey, Wiley
|
1176 | 1134 | pub fn kreyszig_eq6_page902<'a>() -> (
|
1177 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
| 1135 | + System<'a, NoArgs>, |
1178 | 1136 | f64,
|
1179 | 1137 | Vector,
|
1180 | 1138 | NoArgs,
|
@@ -1250,7 +1208,7 @@ impl Samples {
|
1250 | 1208 | /// * Kreyszig, E (2011) Advanced engineering mathematics; in collaboration with Kreyszig H,
|
1251 | 1209 | /// Edward JN 10th ed 2011, Hoboken, New Jersey, Wiley
|
1252 | 1210 | pub fn kreyszig_ex4_page920<'a>() -> (
|
1253 |
| - System<'a, impl Fn(&mut Vector, f64, &Vector, &mut NoArgs) -> Result<(), StrError>, NoArgs>, |
| 1211 | + System<'a, NoArgs>, |
1254 | 1212 | f64,
|
1255 | 1213 | Vector,
|
1256 | 1214 | NoArgs,
|
|
0 commit comments