Liking cljdoc? Tell your friends :D

sicmutils.calculus.derivative

This namespace implements a number of differential operators like D, and the machinery to apply D to various structures.

This namespace implements a number of differential operators like [[D]], and
the machinery to apply [[D]] to various structures.
raw docstring

Dclj/s

Derivative operator. Takes some function f and returns a function whose value at some point can multiply an increment in the arguments, to produce the best linear estimate of the increment in the function value.

For univariate functions, D computes a derivative. For vector-valued functions, D computes the Jacobian of f.

The related [[Grad]] returns a function that produces a structure of the opposite orientation as D. Both of these functions use forward-mode automatic differentiation.

Derivative operator. Takes some function `f` and returns a function
whose value at some point can multiply an increment in the arguments, to
produce the best linear estimate of the increment in the function value.

For univariate functions, [[D]] computes a derivative. For vector-valued
functions, [[D]] computes
the [Jacobian](https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant)
of `f`.

The related [[Grad]] returns a function that produces a structure of the
opposite orientation as [[D]]. Both of these functions use forward-mode
automatic differentiation.
sourceraw docstring

D-as-matrixclj/s

(D-as-matrix F)
source

derivativeclj/s

(derivative f)

Returns a single-argument function of that, when called with an argument x, returns the derivative of f at x using forward-mode automatic differentiation.

For numerical differentiation, see sicmutils.numerical.derivative/D-numeric.

f must be built out of generic operations that know how to handle [[d/Differential]] inputs in addition to any types that a normal (f x) call would present. This restriction does not apply to operations like putting x into a container or destructuring; just primitive function calls.

Returns a single-argument function of that, when called with an argument `x`,
returns the derivative of `f` at `x` using forward-mode automatic
differentiation.

For numerical differentiation,
see [[sicmutils.numerical.derivative/D-numeric]].

`f` must be built out of generic operations that know how to
handle [[d/Differential]] inputs in addition to any types that a normal `(f
x)` call would present. This restriction does _not_ apply to operations like
putting `x` into a container or destructuring; just primitive function calls.
sourceraw docstring

partialclj/s

(partial & selectors)

Returns an operator that, when applied to a function f, produces a function that computes the partial derivative of f at the (zero-based) slot index provided via selectors.

Returns an operator that, when applied to a function `f`, produces a function
that computes the partial derivative of `f` at the (zero-based) slot index
provided via `selectors`.
sourceraw docstring

taylor-seriesclj/s

(taylor-series f x dx)

Returns a sicmutils.series/Series of the coefficients of the taylor series of the function f evaluated at x, with incremental quantity dx.

NOTE: The (constantly dx) term is what allows this to work with arbitrary structures of x and dx. Without this wrapper, ((g/* dx D) f) with dx == (up 'dx 'dy) would expand to this:

(fn [x] (* (s/up ('dx x) ('dy x))
           ((D f) x)))

constantly delays the interpretation of dx one step:

(fn [x] (* (s/up 'dx 'dy)
           ((D f) x)))
Returns a [[sicmutils.series/Series]] of the coefficients of the taylor series
of the function `f` evaluated at `x`, with incremental quantity `dx`.

NOTE: The `(constantly dx)` term is what allows this to work with arbitrary
structures of `x` and `dx`. Without this wrapper, `((g/* dx D) f)` with `dx`
== `(up 'dx 'dy)` would expand to this:

```clojure
(fn [x] (* (s/up ('dx x) ('dy x))
           ((D f) x)))
```

`constantly` delays the interpretation of `dx` one step:

```clojure
(fn [x] (* (s/up 'dx 'dy)
           ((D f) x)))
```
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close