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
69
70
71
72
73
74
75
76
77
/// Example#1
/// ```
///
/// use RustedSciThe::numerical::Nonlinear_systems::prelude::*;
/// use nalgebra::DVector;
///
/// let problem = SymbolicNonlinearProblem::from_strings(
/// vec!["x^2+y^2-10".to_string(), "x-y-4".to_string()],
/// Some(vec!["x".to_string(), "y".to_string()]),
/// None,
/// None,
/// )
/// .expect("problem");
///
/// let result = SolverEngine::new(NewtonMethod, SolveOptions::default())
/// .solve(&problem, DVector::from_vec(vec![1.0, 1.0]))
/// .expect("solve");
///
/// assert!((result.x[0] - 3.0).abs() < 1e-8);
/// ```
/// Example#2
/// ```
/// use RustedSciThe::numerical::Nonlinear_systems::prelude::*;
/// use nalgebra::DVector;
///
/// let options = SymbolicProblemOptions::new()
/// .with_variables(vec!["x".to_string(), "y".to_string()])
/// .with_lambdify_backend();
///
/// let problem = SymbolicNonlinearProblem::from_strings_with_options(
/// vec!["x^2+y^2-10".to_string(), "x-y-4".to_string()],
/// options,
/// )
/// .expect("problem");
///
/// let solve_options = SolveOptions {
/// tolerance: 1e-8,
/// max_iterations: 50,
/// ..SolveOptions::default()
/// };
///
/// let solution = NonlinearSolverMethod::DampedNewton(DampedNewtonMethod::default())
/// .solve(&problem, DVector::from_vec(vec![1.0, 1.0]), solve_options)
/// .expect("solve");
///
/// assert!((solution.x[0] - 3.0).abs() < 1e-6);
/// ```
pub