Class Divergence

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

public class Divergence extends Object
Computes the divergence of a vector field.

The divergence measures the magnitude of a field's source or sink at a given point.

Definition: ∇·F = ∂F₁/∂x₁ + ∂F₂/∂x₂ + ... + ∂Fₙ/∂xₙ

Physical interpretation: - Positive divergence: source (field lines emanating outward) - Negative divergence: sink (field lines converging inward) - Zero divergence: incompressible flow - Gauss's law: ∇·E = ρ/ε₀ (electric field divergence equals charge density) - Continuity equation: ∂ρ/∂t + ∇·(ρv) = 0

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

    • Divergence

      public Divergence()
  • Method Details

    • compute

      public static Real compute(VectorField<PointND> field, PointND point, Real h)
      Computes the divergence of a vector field at a point using finite differences.

      Uses central difference for each component: ∂Fᵢ/∂xᵢ ≈ (Fᵢ(x + h*eᵢ) - Fᵢ(x - h*eᵢ)) / (2h)

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

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