Skip to main content
← OpenMECP Documentation

stepsize_blend

Function stepsize_blend 

Source
pub fn stepsize_blend(
    old_x: &DVector<f64>,
    new_x: &DVector<f64>,
    max_step: f64,
    factor: f64,
) -> DVector<f64>
Expand description

Applies step size reduction and capping.

ยงAlgorithm

  1. Compute displacement: dX = newX - oldX
  2. Scale by factor
  3. If ||dX|| > max_step, rescale to max_step
  4. Return oldX + scaled_dX