pub struct VariationalProblem;Expand description
Variational problem solver: Euler-Lagrange equations and constrained minimization with Lagrange multipliers.
Implementations§
Source§impl VariationalProblem
impl VariationalProblem
Sourcepub fn euler_lagrange_residual<L>(lagrangian: L, u: &[f64], dx: f64) -> Vec<f64>
pub fn euler_lagrange_residual<L>(lagrangian: L, u: &[f64], dx: f64) -> Vec<f64>
Compute the Euler-Lagrange residual for the functional
J\[u\] = ∫ L(x, u, u') dx.
The Lagrangian L takes (x, u, u_prime). Returns the residual
∂L/∂u - d/dx(∂L/∂u') evaluated at each interior grid point using
finite differences.
Sourcepub fn augmented_lagrangian<J, G>(
j: J,
g: G,
u0: &[f64],
rho: f64,
step: f64,
max_iter: usize,
) -> (Vec<f64>, f64)
pub fn augmented_lagrangian<J, G>( j: J, g: G, u0: &[f64], rho: f64, step: f64, max_iter: usize, ) -> (Vec<f64>, f64)
Minimize the functional J\[u\] subject to equality constraint G\[u\] = 0
using the augmented Lagrangian method.
Returns (u, lambda) where u is the minimizer and lambda is the
Lagrange multiplier estimate.
Auto Trait Implementations§
impl Freeze for VariationalProblem
impl RefUnwindSafe for VariationalProblem
impl Send for VariationalProblem
impl Sync for VariationalProblem
impl Unpin for VariationalProblem
impl UnsafeUnpin for VariationalProblem
impl UnwindSafe for VariationalProblem
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<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.