|
static | differentiate ($target, $source,... $args) |
|
static | getPoints ($source, array $args=[]) |
| Determine where the input $source argument is a callback function, a set of arrays, or neither. More...
|
|
static | validate (array $points, $degree) |
| Validate that there are a set number of input arrays (points), that each point array has precisely two numbers, and that no two points share the same first number (x-component) More...
|
|
static | isSpacingConstant (array $sorted) |
| Ensures that the length of each subinterval is equal, or equivalently, that the spacing between each point is equal. More...
|
|
static | isTargetInPoints ($target, array $sorted) |
| Ensures that our target is the x-component of one of the points we supply. More...
|
|
Base class for numerical differentiation techniques.
Numerical differentiation techniques are used to approximate the derivative of a function at an input value.
This class gives each technique a set of common tools, and requires each technique to define a differentiate() method to approximate the derivative of a function at an input value.
static MathPHP\NumericalAnalysis\NumericalDifferentiation\NumericalDifferentiation::getPoints |
( |
|
$source, |
|
|
array |
$args = [] |
|
) |
| |
|
static |
Determine where the input $source argument is a callback function, a set of arrays, or neither.
If $source is a callback function, run it through the functionToPoints() method with the input $args, and set $points to output array. If $source is a set of arrays, simply set $points to $source. If $source is neither, throw an Exception.
- Todo:
Add method to verify function is continuous on our interval.
Add method to verify input arguments are valid. Verify $start and $end are numbers, $end > $start, and $points is an integer > 1
- Parameters
-
callable | array | $source | The source of our approximation. Should be either a callback function or a set of arrays. |
array | $args | The arguments of our callback function: start, end, and n. Example: [0, 8, 5]. If $source is a set of arrays, $args will default to []. |
- Returns
- array
- Exceptions
-
Exception | if $source is not callable or a set of arrays |