This library includes various algorithms for calculus.
Currently it's in heavy development and only few are implemented.
Just wait many more algorithms are coming soon!
If you want, you can contribute too!
If you like this library don't forget to start the repository!
calculus-algorithms / Modules
▸ backwardDiff(fx
, x
, h?
): number
Remarks
This is a numerical method.
Example
backwardDiff(Math.log, 7)
backwardDiff(func1, 3, 0.0001)
const func1 = (arg0: number): number => {
return 1 / (1 + arg0 * arg0)
}
Name | Type | Default value | Description |
---|---|---|---|
fx |
(arg0 : number ) => number |
undefined |
Function to differentiate. |
x |
number |
undefined |
Differentiate at this given value. |
h |
number |
0.0001 |
Optional parameter - step size to use. |
number
differentiation of given function at given value.
differentiation/backwardDividedDifference.ts:22
▸ centralDiff(fx
, x
, h?
): number
Remarks
This is a numerical method.
Example
centralDiff(Math.log, 7)
centralDiff(func1, 3, 0.0001)
const func1 = (arg0: number): number => {
return 1 / (1 + arg0 * arg0)
}
Name | Type | Default value | Description |
---|---|---|---|
fx |
(arg0 : number ) => number |
undefined |
Function to differentiate. |
x |
number |
undefined |
Differentiate at this given value. |
h |
number |
0.0002 |
Optional parameter - step size to use. |
number
differentiation of given function at given value.
differentiation/centralDividedDifference.ts:22
▸ differentiate(expression
): string
Remarks
This is a not a numerical method.
Example
diff("4x^3 - 3x^1 + 2x^2")
Name | Type | Description |
---|---|---|
expression |
string |
Expression to differentiate. |
string
differentiation of given expression.
differentiation/differentiate.ts:48
▸ forwardDiff(fx
, x
, h?
): number
Remarks
This is a numerical method.
Example
forwardDiff(Math.log, 7)
forwardDiff(func1, 3, 0.0001)
const func1 = (arg0: number): number => {
return 1 / (1 + arg0 * arg0)
}
Name | Type | Default value | Description |
---|---|---|---|
fx |
(arg0 : number ) => number |
undefined |
Function to differentiate. |
x |
number |
undefined |
Differentiate at this given value. |
h |
number |
0.0001 |
Optional parameter - step size to use. |
number
differentiation of given function at given value.
differentiation/forwardDividedDifference.ts:22
▸ simpsonOneThird(func
, lowerLimit
, upperLimit
): number
Example
simpsonOneThird(Math.log, 4, 5.2)
simpsonOneThird(func1, 0, 1)
const func1 = (arg0: number): number => {
return 1 / (1 + arg0 * arg0)
}
Name | Type | Description |
---|---|---|
func |
(arg0 : number ) => number |
Function to integrate |
lowerLimit |
number |
Lower limit to integrate within. |
upperLimit |
number |
Upper limit to integrate within. |
number
integration of given function within given limits.
integration/simpsonOneThird.ts:19
▸ simpsonThreeEighth(func
, lowerLimit
, upperLimit
): number
Example
simpsonThreeEighth(Math.log, 4, 5.2)
simpsonThreeEighth(func1, 0, 1)
const func1 = (arg0: number): number => {
return 1 / (1 + arg0 * arg0)
}
Name | Type | Description |
---|---|---|
func |
(arg0 : number ) => number |
Function to integrate |
lowerLimit |
number |
Lower limit to integrate within. |
upperLimit |
number |
Upper limit to integrate within. |
number
integration of given function within given limits.
integration/simpsonThreeEighth.ts:19
▸ trapezoidalRule(func
, lowerLimit
, upperLimit
): number
Example
trapezoidalRule(Math.log, 4, 5.2)
trapezoidalRule(func1, 0, 1)
const func1 = (arg0: number): number => {
return 1 / (1 + arg0 * arg0)
}
Name | Type | Description |
---|---|---|
func |
(arg0 : number ) => number |
Function to integrate |
lowerLimit |
number |
Lower limit to integrate within. |
upperLimit |
number |
Upper limit to integrate within. |
number
integration of given function within given limits.