Class Gradient

java.lang.Object
org.episteme.core.mathematics.analysis.vectorcalculus.Gradient

public class Gradient extends Object
Computes the gradient of a scalar field.

The gradient is a vector field that points in the direction of the greatest rate of increase of the scalar field.

Definition: ∇f = (∂f/∂x₁, ∂f/∂x₂, ..., ∂f/∂xₙ)

Physical interpretation: - Direction of steepest ascent - Electric field: E = -∇φ (negative gradient of potential) - Force from potential: F = -∇U

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • Gradient

      public Gradient()
  • Method Details

    • compute

      public static Vector<Real> compute(ScalarField<PointND> field, PointND point, Real h)
      Computes the gradient of a scalar field at a point using finite differences.

      Uses central difference: ∂f/∂xᵢ ≈ (f(x + h*eᵢ) - f(x - h*eᵢ)) / (2h)

      Parameters:
      field - the scalar field
      point - the point at which to compute the gradient
      h - the step size for numerical differentiation
      Returns:
      the gradient vector
    • asField

      public static VectorField<PointND> asField(ScalarField<PointND> field, Real h)
      Returns a vector field representing the gradient of the scalar field.
      Parameters:
      field - the scalar field
      h - the step size for numerical differentiation
      Returns:
      the gradient as a vector field