pub struct NonlinearSystem {
pub equations: Vec<Expression>,
pub variables: Vec<Variable>,
}Expand description
A system of nonlinear equations F(x) = 0.
Fields§
§equations: Vec<Expression>The equations F_i(x) (each should equal 0).
variables: Vec<Variable>The variables in order.
Implementations§
Source§impl NonlinearSystem
impl NonlinearSystem
Sourcepub fn new(equations: Vec<Expression>, variables: Vec<Variable>) -> Self
pub fn new(equations: Vec<Expression>, variables: Vec<Variable>) -> Self
Create a new nonlinear system.
Sourcepub fn from_equations(
equations: Vec<Equation>,
variables: Vec<Variable>,
) -> Self
pub fn from_equations( equations: Vec<Equation>, variables: Vec<Variable>, ) -> Self
Create from Equation types (converts to F(x) = 0 form).
Sourcepub fn num_equations(&self) -> usize
pub fn num_equations(&self) -> usize
Number of equations.
Sourcepub fn num_variables(&self) -> usize
pub fn num_variables(&self) -> usize
Number of variables.
Sourcepub fn evaluate(
&self,
point: &[f64],
) -> Result<Vec<f64>, NonlinearSystemSolverError>
pub fn evaluate( &self, point: &[f64], ) -> Result<Vec<f64>, NonlinearSystemSolverError>
Evaluate all equations at a point.
Sourcepub fn jacobian(
&self,
) -> Result<Vec<Vec<Expression>>, NonlinearSystemSolverError>
pub fn jacobian( &self, ) -> Result<Vec<Vec<Expression>>, NonlinearSystemSolverError>
Compute the Jacobian matrix symbolically. Returns J[i][j] = ∂F_i/∂x_j
Sourcepub fn evaluate_jacobian(
&self,
point: &[f64],
) -> Result<Vec<Vec<f64>>, NonlinearSystemSolverError>
pub fn evaluate_jacobian( &self, point: &[f64], ) -> Result<Vec<Vec<f64>>, NonlinearSystemSolverError>
Evaluate the Jacobian matrix at a point.
Sourcepub fn variable_names(&self) -> Vec<String>
pub fn variable_names(&self) -> Vec<String>
Variable names as strings.
Trait Implementations§
Source§impl Clone for NonlinearSystem
impl Clone for NonlinearSystem
Source§fn clone(&self) -> NonlinearSystem
fn clone(&self) -> NonlinearSystem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NonlinearSystem
impl RefUnwindSafe for NonlinearSystem
impl Send for NonlinearSystem
impl Sync for NonlinearSystem
impl Unpin for NonlinearSystem
impl UnwindSafe for NonlinearSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.