FiniteDifferencesDifferentiator

org.abh80.nf.core.math.calculus.FiniteDifferencesDifferentiator
class FiniteDifferencesDifferentiator(val nbPoints: Int, val stepSize: Double, val tMin: Double, val tMax: Double) extends Serializable

Implements finite differences method for numerical differentiation of functions. This class uses Newton's divided differences formula to compute derivatives of arbitrary order for a given function.

Value parameters

nbPoints

Number of points to use in the differentiation scheme (must be > 1)

stepSize

Step size between successive points (must be > 0)

tMax

Maximum abscissa value (can be Double.PositiveInfinity)

tMin

Minimum abscissa value (can be Double.NegativeInfinity)

Attributes

Note

Even though not a case class, the instances of this class are guaranteed to be immutable

Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Members list

Value members

Constructors

def this(nbPoints: Int, stepSize: Double)

Constructs a differentiator with unbounded domain.

Constructs a differentiator with unbounded domain.

Value parameters

nbPoints

Number of points to use in the differentiation scheme

stepSize

Step size between successive points

Attributes

Concrete methods

def differentiate(f: Double => Double): Double => Int => Double

Differentiates the input function and returns a function that provides the derivative of the specified order.

Differentiates the input function and returns a function that provides the derivative of the specified order.

Value parameters

f

The function to differentiate.

Attributes

Returns

A function that takes a point x and returns a function from order to derivative value.

def differentiateToWrapper(f: Double => Double, x: Double, maxOrder: Int): DerivativeWrapper

Differentiates the input function at point x and returns a DerivativeWrapper containing the function value and all partial derivatives up to maxOrder.

Differentiates the input function at point x and returns a DerivativeWrapper containing the function value and all partial derivatives up to maxOrder.

Value parameters

f

The function to differentiate.

maxOrder

The maximum derivation order (must be less than nbPoints).

x

The point at which to evaluate the derivatives.

Attributes

Returns

A DerivativeWrapper containing the function value and derivatives.

Concrete fields

val nbPoints: Int
val stepSize: Double
val tMax: Double
val tMin: Double