Class Gradient
java.lang.Object
org.episteme.core.mathematics.analysis.vectorcalculus.Gradient
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VectorField<PointND> asField(ScalarField<PointND> field, Real h) Returns a vector field representing the gradient of the scalar field.compute(ScalarField<PointND> field, PointND point, Real h) Computes the gradient of a scalar field at a point using finite differences.
-
Constructor Details
-
Gradient
public Gradient()
-
-
Method Details
-
compute
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 fieldpoint- the point at which to compute the gradienth- the step size for numerical differentiation- Returns:
- the gradient vector
-
asField
Returns a vector field representing the gradient of the scalar field.- Parameters:
field- the scalar fieldh- the step size for numerical differentiation- Returns:
- the gradient as a vector field
-