Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

sicmutils.env

Batteries-included namespace for the SICMUtils library.

The purpose of sicmutils.env is to bundle all of the functions used in Structure and Interpretation of Classical Mechanics and Functional Differential Geometry into a single scope. The following form will import everything from sicmutils.env into your REPL:

(require '[sicmutils.env :as e])
(e/bootstrap-repl!)

Or, in Clojure:

(require '[sicmutils.env :as e :refer :all])
Batteries-included namespace for the [SICMUtils](https://github.com/sicmutils/sicmutils/) library.

The purpose of [[sicmutils.env]] is to bundle all of the functions used
in [Structure and Interpretation of Classical
Mechanics](https://tgvaughan.github.io/sicm/) and [Functional Differential
Geometry](https://mitpress.mit.edu/books/functional-differential-geometry)
into a single scope. The following form will import everything
from [[sicmutils.env]] into your REPL:

```clojure
(require '[sicmutils.env :as e])
(e/bootstrap-repl!)
```

Or, in Clojure:

```clojure
(require '[sicmutils.env :as e :refer :all])
```
raw docstring

*clj/s≠

clj
(*)
(* x)
(* x y)
(* x y & more)

Generic implementation of *. Returns the product of all supplied arguments. (*) returns 1, the multiplicative identity.

When applied between numbers, acts like clojure.core/*. Dispatch is open, however, making it possible to 'multiply' types wherever the behavior is mathematically sound.

For example:

(* 2 #sicm/complex "3 + 1i")
;;=> #sicm/complex "6 + 2i"
Generic implementation of `*`. Returns the product of all supplied
arguments. `(*)` returns 1, the multiplicative identity.

When applied between numbers, acts like `clojure.core/*`. Dispatch is open,
however, making it possible to 'multiply' types wherever the behavior is
mathematically sound.

For example:

```clojure
(* 2 #sicm/complex "3 + 1i")
;;=> #sicm/complex "6 + 2i"
```
cljs
source (clj)source (cljs)raw docstring

+clj/s≠

clj
(+)
(+ x)
(+ x y)
(+ x y & more)

Generic implementation of +. Returns the sum of all supplied arguments. (+) returns 0, the additive identity.

When applied between numbers, acts like clojure.core/+. Dispatch is open, however, making it possible to 'add' types wherever the behavior is mathematically sound.

For example:

(+ [1 2 3] [2 3 4])
;;=> ([[structure/up]] 3 5 7)
Generic implementation of `+`. Returns the sum of all supplied arguments. `(+)`
returns 0, the additive identity.

When applied between numbers, acts like `clojure.core/+`. Dispatch is open,
however, making it possible to 'add' types wherever the behavior is
mathematically sound.

For example:

```clojure
(+ [1 2 3] [2 3 4])
;;=> ([[structure/up]] 3 5 7)
```
cljs
source (clj)source (cljs)raw docstring

-clj/s≠

clj
(-)
(- x)
(- x y)
(- x y & more)

Generic implementation of -.

If one argument is supplied, returns the negation of a. Else returns the difference of the first argument a and the sum of all remaining arguments. (-) returns 0.

When applied between numbers, acts like clojure.core/-. Dispatch is open, however, making it possible to 'subtract' types wherever the behavior is mathematically sound.

For example:

(- [1 2 3] [2 3 4])
;;=> ([[structure/up]] -1 -1 -1)

(- [1 10])
;;=> ([[structure/up]] -1 -10)
Generic implementation of `-`.

If one argument is supplied, returns the negation of `a`. Else returns the
difference of the first argument `a` and the sum of all remaining
arguments. `(-)` returns 0.

When applied between numbers, acts like `clojure.core/-`. Dispatch is open,
however, making it possible to 'subtract' types wherever the behavior is
mathematically sound.

For example:

```clojure
(- [1 2 3] [2 3 4])
;;=> ([[structure/up]] -1 -1 -1)

(- [1 10])
;;=> ([[structure/up]] -1 -10)
```
cljs
source (clj)source (cljs)raw docstring

->infixclj/s≠

clj

Converts an S-expression to printable infix form. Numeric exponents are written as superscripts. Partial derivatives get subscripts.

Converts an S-expression to printable infix form. Numeric exponents
are written as superscripts. Partial derivatives get subscripts.
source (clj)source (cljs)raw docstring

->tex-equationclj/s

(->tex-equation expr & {:keys [label]})

Returns a string containing a LaTeX representation of expr, wrapped in an equation environment.

Optionally supply a :label keyword argument to set a custom label.

Returns a string containing a LaTeX representation of `expr`, wrapped in an
`equation` environment.

Optionally supply a `:label` keyword argument to set a custom label.
sourceraw docstring

-piclj/s

The negation of the mathematical constant Pi.

The negation of the mathematical
constant [Pi](https://en.wikipedia.org/wiki/Pi).
sourceraw docstring

/clj/s≠

clj
(/)
(/ x)
(/ x y)
(/ x y & more)

Generic implementation of /.

If one argument is supplied, returns the multiplicative inverse of a. Else returns the result of dividing first argument a by the product of all remaining arguments. (/) returns 1, the multiplicative identity.

When applied between numbers, acts like clojure.core//. Dispatch is open, however, making it possible to 'divide' types wherever the behavior is mathematically sound.

For example:

(/ [2 4 6] 2)
([[structure/up]] 1 2 3)
Generic implementation of `/`.

If one argument is supplied, returns the multiplicative inverse of `a`. Else
returns the result of dividing first argument `a` by the product of all
remaining arguments. `(/)` returns 1, the multiplicative identity.

When applied between numbers, acts like `clojure.core//`. Dispatch is open,
however, making it possible to 'divide' types wherever the behavior is
mathematically sound.

For example:

```clojure
(/ [2 4 6] 2)
([[structure/up]] 1 2 3)
```
cljs
source (clj)source (cljs)raw docstring

absclj/s≠multimethod

clj
(abs a)

generic abs

generic abs
cljs
source (clj)source (cljs)raw docstring

accelerationclj/s≠

clj
(acceleration local)

Returns the acceleration element of a local tuple (by convention, the fourth element).

See coordinate for more detail.

Returns the acceleration element of a local tuple (by convention, the fourth
element).

See [[coordinate]] for more detail.
cljs
source (clj)source (cljs)raw docstring

acceleration-tupleclj/s

source (clj)source (cljs)

acosclj/s≠multimethod

clj
(acos a)

generic acos

generic acos
cljs
source (clj)source (cljs)raw docstring

acoshclj/s≠multimethod

clj
(acosh a)

generic acosh

generic acosh
cljs
source (clj)source (cljs)raw docstring

alternate-anglesclj/s

source (clj)source (cljs)

angleclj/s≠multimethod

clj
(angle a)

generic angle

generic angle
cljs
source (clj)source (cljs)raw docstring

arg-scaleclj/s≠

clj
(arg-scale f & factors)

Takes a function f and a sequence of factors, and returns a new function that multiplies each factor by the corresponding argument of f. Too many or two few factors are ignored.

((arg-scale square 3) 4) ==> 144
((arg-scale square 3 2 1) 4) ==> 144
Takes a function `f` and a sequence of `factors`, and returns a new function
that multiplies each factor by the corresponding argument of `f`. Too many or
two few factors are ignored.

```clojure
((arg-scale square 3) 4) ==> 144
((arg-scale square 3 2 1) 4) ==> 144
```
cljs
source (clj)source (cljs)raw docstring

arg-shiftclj/s≠

clj
(arg-shift f & shifts)

Takes a function f and a sequence of shifts, and returns a new function that adds each shift to the corresponding argument of f. Too many or two few shifts are ignored.

((arg-shift square 3) 4) ==> 49
((arg-shift square 3 2 1) 4) ==> 49
Takes a function `f` and a sequence of `shifts`, and returns a new function
that adds each shift to the corresponding argument of `f`. Too many or two few
shifts are ignored.

```clojure
((arg-shift square 3) 4) ==> 49
((arg-shift square 3 2 1) 4) ==> 49
```
cljs
source (clj)source (cljs)raw docstring

arityclj/s≠

clj
(arity f)

Return the cached or obvious arity of f if we know it. Otherwise delegates to heavy duty reflection.

Return the cached or obvious arity of `f` if we know it. Otherwise
delegates to heavy duty reflection.
cljs
sourceraw docstring

asinclj/s≠multimethod

clj
(asin a)

generic asin

generic asin
cljs
source (clj)source (cljs)raw docstring

asinhclj/s≠multimethod

clj
(asinh a)

generic asinh

generic asinh
cljs
source (clj)source (cljs)raw docstring

atanclj/s≠multimethod

clj
(atan a)
(atan a b)

generic atan

generic atan
cljs
source (clj)source (cljs)raw docstring

atanhclj/s≠multimethod

clj
(atanh a)

generic atanh

generic atanh
cljs
source (clj)source (cljs)raw docstring

basis->basis-over-mapclj/s≠

clj
(basis->basis-over-map mu:N->M basis-on-M)
cljs
source (clj)source (cljs)

basis->oneform-basisclj/s≠

clj
(basis->oneform-basis b)

Extract the dual basis from the given basis object b.

Extract the dual basis from the given basis object `b`.
cljs
source (clj)source (cljs)raw docstring

basis->vector-basisclj/s≠

clj
(basis->vector-basis b)

Extract the vector basis from the given basis object b.

Extract the vector basis from the given basis object `b`.
cljs
source (clj)source (cljs)raw docstring

binomial-seriesclj/s≠

clj
(binomial-series alpha)

Returns a [[PowerSeries]] instance representing a Binomial series, ie, the taylor series of the function $f$ given by

$$f(x) = (1 + x)^\alpha$$
Returns a [[PowerSeries]] instance representing a
[Binomial series](https://en.wikipedia.org/wiki/Binomial_series), ie, the
taylor series of the function $f$ given by

```
$$f(x) = (1 + x)^\alpha$$
```
cljs
source (clj)source (cljs)raw docstring

bootstrap-repl!clj/smacro

(bootstrap-repl!)

Bootstraps a repl or Clojure namespace by requiring all public vars from sicmutils.env.

(This will only work at a repl in Clojurescript.)

TODO add support for refer-macros in Clojurescript TODO add rename, exclude support.

Bootstraps a repl or Clojure namespace by requiring all public vars
from [[sicmutils.env]].

(This will only work at a repl in Clojurescript.)

TODO add support for `refer-macros` in Clojurescript
TODO add rename, exclude support.
sourceraw docstring

brent-maxclj/s≠

clj
(brent-max f a b opts)

For convenience, we also provide the sister-procedure for finding the maximum of a unimodal function using Brent's method.

Negate the function, minimize, negate the result.

For convenience, we also provide the sister-procedure for finding the maximum
of a unimodal function using Brent's method.

Negate the function, minimize, negate the result.
cljs
source (clj)source (cljs)raw docstring

brent-minclj/s≠

clj
(brent-min f a b)
(brent-min f
           a
           b
           {:keys [relative-threshold absolute-threshold maxiter maxfun
                   callback]
            :or {relative-threshold (g/sqrt v/machine-epsilon)
                 absolute-threshold 1.0E-11
                 maxiter 1000
                 callback (constantly nil)}})

Find the minimum of the function f: R -> R in the interval [a,b] using Brent's Method, described by Richard Brent in Algorithms for Minimization without Derivatives.

Brent's method is a combination of a golden section search with a parabolic interpolation step. Parabolic interpolation can go wild if the candidate point is close to colinear with the search bounds, or of the points are too close together.

Brent's method prevents this by applying an internal test that forces a golden section step every so often. (If you want the details, see parabola-valid? above.)

Supports the following optional keyword arguments:

:callback if supplied, the supplied fn will be invoked at each intermediate point with the iteration count and the values of x and f(x) at each search step.

:relative-threshold defaults to around 1.49e8, the sqrt of the machine tolerance. You won't gain any benefit attempting to set the value less than the default.

:absolute-threshold a smaller absolute threshold that applies when the candidate minimum point is close to 0.

:maxiter Maximum number of iterations allowed for the minimizer. Defaults to 1000.

:maxfun Maximum number of times the function can be evaluated before exiting. Defaults to (inc maxiter).

Find the minimum of the function f: R -> R in the interval [a,b] using Brent's
Method, described by Richard Brent in [Algorithms for Minimization without
Derivatives](https://books.google.com/books?id=AITCAgAAQBAJ&q=Brent%E2%80%99s#v=onepage&q=Parabolic&f=false).

Brent's method is a combination of a golden section search with a parabolic
interpolation step. Parabolic interpolation can go wild if the candidate point
is close to colinear with the search bounds, or of the points are too close
together.

Brent's method prevents this by applying an internal test that forces a golden
section step every so often. (If you want the details, see `parabola-valid?`
above.)

Supports the following optional keyword arguments:

`:callback` if supplied, the supplied fn will be invoked at each intermediate
point with the iteration count and the values of x and f(x) at each search
step.

`:relative-threshold` defaults to around 1.49e8, the sqrt of the machine
tolerance. You won't gain any benefit attempting to set the value less than
the default.

`:absolute-threshold` a smaller absolute threshold that applies when the
candidate minimum point is close to 0.

`:maxiter` Maximum number of iterations allowed for the minimizer. Defaults to
1000.

`:maxfun` Maximum number of times the function can be evaluated before
exiting. Defaults to `(inc maxiter)`.
cljs
source (clj)source (cljs)raw docstring

Cartan-transformclj/s≠

clj
(Cartan-transform cartan basis-prime)
cljs
source (clj)source (cljs)

ceilingclj/s≠multimethod

clj
(ceiling a)

generic ceiling.

Returns the result of rounding a up to the next largest integer.

Extensions beyond real numbers may behave differently; see the Documentation site for more detail.

generic ceiling.

Returns the result of rounding `a` up to the next largest integer.

  Extensions beyond real numbers may behave differently; see the [Documentation
  site](https://cljdoc.org/d/sicmutils/sicmutils/CURRENT/doc/basics/generics)
  for more detail.
cljs
source (clj)source (cljs)raw docstring

chartclj/s≠

clj
(chart coordinate-system)
cljs
source (clj)source (cljs)

chinese-remainderclj/s≠

clj
(chinese-remainder & modints)

Chinese Remainder Algorithm.

Accepts a sequence of [[ModInt]] instances (where the modulus :m of all [[ModInt]] instances are relatively prime), and returns a [[ModInt]] x such that (:i input) == (mod x (:m input)).

For example:

(let [a1 (m/make 2 5)
      a2 (m/make 3 13)]
  [(= 42 (chinese-remainder a1 a2))
   (= (:i a1) (mod cr (:m a1)))
   (= (:i a2) (mod cr (:m a2)))])
;;=> [true true true]
[Chinese Remainder Algorithm](https://en.wikipedia.org/wiki/Chinese_remainder_theorem).

Accepts a sequence of [[ModInt]] instances (where the modulus `:m` of
all [[ModInt]] instances are relatively prime), and returns a [[ModInt]] `x`
such that `(:i input) == (mod x (:m input))`.

For example:

```clojure
(let [a1 (m/make 2 5)
      a2 (m/make 3 13)]
  [(= 42 (chinese-remainder a1 a2))
   (= (:i a1) (mod cr (:m a1)))
   (= (:i a2) (mod cr (:m a2)))])
;;=> [true true true]
```
cljs
source (clj)source (cljs)raw docstring

Christoffel->Cartanclj/s≠

clj
(Christoffel->Cartan Christoffel)
cljs
source (clj)source (cljs)

column-matrixclj/s≠

clj
(column-matrix & xs)

Returns a column matrix populated by the supplied xs. Variadic equivalent to [[column*]].

Returns a column matrix populated by the supplied `xs`. Variadic equivalent
to [[column*]].
cljs
source (clj)source (cljs)raw docstring

column-matrix->upclj/s≠

clj
(column-matrix->up m)

Returns the single column from the supplied column matrix as an up. Errors if some other type is supplied.

Returns the single column from the supplied column matrix as an `up`. Errors if
some other type is supplied.
cljs
source (clj)source (cljs)raw docstring

column-matrix->vectorclj/s≠

clj
(column-matrix->vector m)

Returns the single column from the supplied column matrix as a vector. Errors if some other type is supplied.

Returns the single column from the supplied column matrix as a vector. Errors
if some other type is supplied.
cljs
source (clj)source (cljs)raw docstring

commutatorclj/s≠

clj
(commutator o p)
cljs
source (clj)source (cljs)

compareclj/s≠

clj
(compare x y)

Comparator. Returns a negative number, zero, or a positive number when x is logically 'less than', 'equal to', or 'greater than' y. Same as Java x.compareTo(y) except it also works for nil, and compares numbers and collections in a type-independent manner. x must implement Comparable

Comparator. Returns a negative number, zero, or a positive number
when x is logically 'less than', 'equal to', or 'greater than'
y. Same as Java x.compareTo(y) except it also works for nil, and
compares numbers and collections in a type-independent manner. x
must implement Comparable
cljs
source (clj)source (cljs)raw docstring

compatible-shapeclj/s≠

clj
(compatible-shape s)

Returns a structure compatible for multiplication with s down to a scalar, with the slots filled with gensyms.

Returns a structure compatible for multiplication with `s` down to a scalar,
with the slots filled with gensyms.
cljs
source (clj)source (cljs)raw docstring

complexclj/s≠

clj
(complex re)
(complex re im)

Returns a [[Complex]] number with the supplied real part re and imaginary part im. im defaults to 0.

Returns a [[Complex]] number with the supplied real part `re` and imaginary
part `im`. `im` defaults to 0.
cljs
source (clj)source (cljs)raw docstring

componentclj/s

(component & selectors)

Given a sequence of selectors, return a function that accepts some object x and returns:

(apply ref x selectors)
Given a sequence of `selectors`, return a function that accepts some object `x`
and returns:

```clojure
(apply ref x selectors)
```
sourceraw docstring

components->oneform-fieldclj/s≠

clj
(components->oneform-field components coordinate-system & [name])
cljs
source (clj)source (cljs)

components->vector-fieldclj/s≠

clj
(components->vector-field components coordinate-system & [name])
cljs
source (clj)source (cljs)

composeclj/s≠

clj
(compose & fns)

Arity-preserving version of clojure.core/comp.

The arity of a composition is the arity of the rightmost (that is, first to be applied) function term in fns.

Arity-preserving version of `clojure.core/comp`.

The arity of a composition is the arity of the rightmost (that is, first to be
applied) function term in `fns`.
cljs
source (clj)source (cljs)raw docstring

compositional-canonical?clj/s≠

clj
(compositional-canonical? C H)

p.324

p.324
cljs
source (clj)source (cljs)raw docstring

conjugateclj/s≠multimethod

clj
(conjugate a)

generic conjugate

generic conjugate
cljs
source (clj)source (cljs)raw docstring

constant-seriesclj/s≠

clj
(constant-series c)
(constant-series c kind)

Returns a [[PowerSeries]] representing the supplied constant term.

Optionally, pass kind of either ::series or ::power-series to specify the type of series returned.

Returns a [[PowerSeries]] representing the supplied constant term.

Optionally, pass `kind` of either `::series` or `::power-series` to specify
the type of series returned.
cljs
source (clj)source (cljs)raw docstring

coordinateclj/s≠

clj
(coordinate local)

A convenience function on local tuples. A local tuple describes the state of a system at a particular time:

[t, q, D q, D^2 q]

representing time, position, velocity (and optionally acceleration etc.) coordinate returns the q element, which is expected to be a mapping from time to a structure of coordinates.

A convenience function on local tuples. A local tuple describes
the state of a system at a particular time:

```
[t, q, D q, D^2 q]
```

representing time, position, velocity (and optionally acceleration etc.)
[[coordinate]] returns the `q` element, which is expected to be a mapping from
time to a structure of coordinates.
cljs
source (clj)source (cljs)raw docstring

coordinate-system->basisclj/s≠

clj
(coordinate-system->basis coordinate-system)

Returns the standard basis object for coordinate-system.

Returns the standard basis object for `coordinate-system`.
cljs
source (clj)source (cljs)raw docstring

coordinate-system->oneform-basisclj/s≠

clj
(coordinate-system->oneform-basis coordinate-system)
cljs
source (clj)source (cljs)

coordinate-system->vector-basisclj/s≠

clj
(coordinate-system->vector-basis coordinate-system)
cljs
source (clj)source (cljs)

coordinate-tupleclj/s

source (clj)source (cljs)

coordinatizeclj/s≠

clj
(coordinatize v coordinate-system)
cljs
source (clj)source (cljs)

cosclj/s≠multimethod

clj
(cos a)

generic cos

generic cos
cljs
source (clj)source (cljs)raw docstring

coshclj/s≠multimethod

clj
(cosh a)

generic cosh

generic cosh
cljs
source (clj)source (cljs)raw docstring

cotclj/s≠multimethod

clj
(cot a)

generic cot

generic cot
cljs
source (clj)source (cljs)raw docstring

covariant-derivativeclj/s≠

clj
(covariant-derivative Cartan)
(covariant-derivative Cartan map)
cljs
source (clj)source (cljs)

cross-productclj/s≠multimethod

clj
(cross-product a b)

generic cross-product

generic cross-product
cljs
source (clj)source (cljs)raw docstring

cscclj/s≠multimethod

clj
(csc a)

generic csc

generic csc
cljs
source (clj)source (cljs)raw docstring

cschclj/s≠multimethod

clj
(csch a)

generic csch

generic csch
cljs
source (clj)source (cljs)raw docstring

cubeclj/s≠multimethod

clj
(cube a)

generic cube

generic cube
cljs
source (clj)source (cljs)raw docstring

Curlclj/s≠

clj

Operator that takes a function f and returns a function that calculates the Curl of f at its input point.

f must be a function from $\mathbb{R}^3 \to \mathbb{R}^3$.

Operator that takes a function `f` and returns a function that
calculates the [Curl](https://en.wikipedia.org/wiki/Curl_(mathematics)) of `f`
at its input point.

`f` must be a function from $\mathbb{R}^3 \to \mathbb{R}^3$.
source (clj)source (cljs)raw docstring

Dclj/s≠

clj

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.
source (clj)source (cljs)raw docstring

D-numericclj/s≠

clj
(D-numeric f)
(D-numeric f opts)

Takes a function f: R => R (function of a single real variable), and returns a new function of x that approximates the derivative $Df(x)$ (or $D^2f(x)$ if you pass :method :central-d2).

Returns the estimated value of the derivative at x. If you pass :info? true, the fn returns a dictionary of the results of us/seq-limit:

{:converged? <boolean>
 :terms-checked <int>
 :result <derivative estimate>}

Make sure to visit sicmutils.calculus.derivative/D if you want symbolic or automatic differentiation.

Roundoff Estimate

The returned function will attempt to estimate how many times it can halve the step size used to estimate the derivative before roundoff error swamps the calculation, and force the function to return (with :converged? false, if you pass :info?)

Optional Arguments

D-numeric takes optional args as its second param. Any of these can be overridden by passing a second argument to the function returned by D-numeric; helpful for setting defaults and then overriding them later.

The returned function passes through these and any other options to us/seq-limit, where they control the sequence of richardson extrapolation-accelerated estimates.

Options:

  • :method: one of :central, :central-d2, :forward or :backward. :central-d2 forces a second derivative estimate; the other methods configure a first derivative estimator.

  • :info? if false (default), returns the estimated value of x. If true, returns a dictionary with more information (see D-numeric's docstring for more info.)

  • :initial-h: the initial h to use for derivative estimates before $h o 0$. Defaults to 0.1 * abs(x).

  • :tolerance: see us/stream-limit for a discussion of how this value handles relative vs absolute tolerance. $\sqrt(\epsilon)$ by default, where $\epsilon$ = machine tolerance.

  • :maxterms: the maximum number of terms to consider when hunting for a derivative estimate. This defaults to an estimate generated internally, designed to prevent roundoff error from swamping the result. If you want to disable this feature, set :maxterms to something moderately large, like :maxterms 100. But do so carefully! See the surrounding namespace for a larger discussion.

Takes a function `f: R => R` (function of a single real variable), and returns
a new function of `x` that approximates the derivative $Df(x)$ (or $D^2f(x)$
if you pass `:method :central-d2`).

Returns the estimated value of the derivative at `x`. If you pass `:info?
true`, the fn returns a dictionary of the results of `us/seq-limit`:

```clojure
{:converged? <boolean>
 :terms-checked <int>
 :result <derivative estimate>}
```

Make sure to visit [[sicmutils.calculus.derivative/D]] if you want symbolic or
automatic differentiation.

### Roundoff Estimate

The returned function will attempt to estimate how many times it can halve the
step size used to estimate the derivative before roundoff error swamps the
calculation, and force the function to return (with `:converged? false`, if
you pass `:info?`)

### Optional Arguments

`D-numeric` takes optional args as its second param. Any of these can be
overridden by passing a second argument to the function returned by
`D-numeric`; helpful for setting defaults and then overriding them later.

The returned function passes through these and any other options to
`us/seq-limit`, where they control the sequence of richardson
extrapolation-accelerated estimates.

Options:

- `:method`: one of `:central`, `:central-d2`, `:forward` or `:backward`.
`:central-d2` forces a second derivative estimate; the other methods configure
a first derivative estimator.

- `:info?` if false (default), returns the estimated value of `x`. If true,
returns a dictionary with more information (see `D-numeric`'s docstring for
more info.)

- `:initial-h`: the initial `h` to use for derivative estimates before $h 	o
0$. Defaults to `0.1 * abs(x)`.

- `:tolerance`: see `us/stream-limit` for a discussion of how this value
handles relative vs absolute tolerance. $\sqrt(\epsilon)$ by default, where
$\epsilon$ = machine tolerance.

- `:maxterms`: the maximum number of terms to consider when hunting for a
derivative estimate. This defaults to an estimate generated internally,
designed to prevent roundoff error from swamping the result. If you want to
disable this feature, set `:maxterms` to something moderately large, like
`:maxterms 100`. But do so carefully! See the surrounding namespace for a
larger discussion.
cljs
source (clj)source (cljs)raw docstring

definite-integralclj/s≠

clj
(definite-integral f a b)
(definite-integral f
                   a
                   b
                   {:keys [method compile? info?]
                    :or {method :open compile? false info? false}
                    :as opts})

Evaluates the definite integral of integrand f across the interval $a, b$. Optionally accepts a dictionary opts of customizing options; All opts will be passed through to the supplied integrate functions.

If you'd like more control, or to retrieve the integration function directly without looking it up via :method each time, see get-integrator.

All supplied options are passed through to the underlying integrator; see the specific integrator for information on what options are available.

Keyword arguments:

:method: Specifies the integration method used. Must be

  • a keyword naming one of the available methods in available-methods
  • a function with the proper integrator signature
  • a dictionary of integrator options with a :method key

Defaults to :open, which specifies an adaptive bulirsch-stoer quadrature method.

:compile? If true, the generic function will be simplified and compiled before execution.

:info? If true, definite-integral will return a map of integration information returned by the underlying integrator. Else, returns an estimate of the definite integral.

Evaluates the definite integral of integrand `f` across the interval $a, b$.
Optionally accepts a dictionary `opts` of customizing options; All `opts` will
be passed through to the supplied `integrate` functions.

If you'd like more control, or to retrieve the integration function directly
without looking it up via `:method` each time, see `get-integrator`.

All supplied options are passed through to the underlying integrator; see the
specific integrator for information on what options are available.

## Keyword arguments:

`:method`: Specifies the integration method used. Must be

- a keyword naming one of the available methods in `available-methods`
- a function with the proper integrator signature
- a dictionary of integrator options with a `:method` key

Defaults to `:open`, which specifies an adaptive bulirsch-stoer quadrature method.

`:compile?` If true, the generic function will be simplified and compiled
before execution.

`:info?` If true, `definite-integral` will return a map of integration
information returned by the underlying integrator. Else, returns an estimate
of the definite integral.
cljs
source (clj)source (cljs)raw docstring

derivativeclj/s≠

clj
(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.
cljs
source (clj)source (cljs)raw docstring

determinantclj/s≠multimethod

clj
(determinant a)

generic determinant

generic determinant
cljs
source (clj)source (cljs)raw docstring

differentialclj/s≠

clj
(differential mu:N->M)

Defined on FDG p.72.

Defined on FDG p.72.
cljs
source (clj)source (cljs)raw docstring

dimensionclj/s≠multimethod

clj
(dimension a)

generic dimension

generic dimension
cljs
source (clj)source (cljs)raw docstring

Divclj/s≠

clj

Operator that takes a function f and returns a function that calculates the Divergence of f at its input point.

The divergence is a one-level contraction of the gradient.

Operator that takes a function `f` and returns a function that
 calculates the [Divergence](https://en.wikipedia.org/wiki/Divergence) of
 `f` at its input point.

The divergence is a one-level contraction of the gradient.
source (clj)source (cljs)raw docstring

divideclj/s≠

clj

Alias for /.

Alias for [[/]].
source (clj)source (cljs)raw docstring

dot-productclj/s≠multimethod

clj
(dot-product a b)

generic dot-product

generic dot-product
cljs
source (clj)source (cljs)raw docstring

downclj/s≠

clj
(down & xs)

Construct a down (covariant) tuple from the arguments. Variadic version of [[down*]].

Construct a down (covariant) tuple from the arguments. Variadic version
of [[down*]].
cljs
source (clj)source (cljs)raw docstring

down->row-matrixclj/s≠

clj
(down->row-matrix v)

Returns a row matrix with the contents of the supplied down structure. Errors if any other type is provided.

Returns a row matrix with the contents of the supplied `down` structure.
Errors if any other type is provided.
cljs
source (clj)source (cljs)raw docstring

elliptic-fclj/s≠

clj
(elliptic-f phi k)

Legendre elliptic integral of the first kind F(φ, k). See W.H. Press, Numerical Recipes in C++, 2ed. eq. 6.11.19

See page 260.

Legendre elliptic integral of the first kind F(φ, k).
 See W.H. Press, Numerical Recipes in C++, 2ed. eq. 6.11.19

See [page 260](http://phys.uri.edu/nigh/NumRec/bookfpdf/f6-11.pdf).
cljs
source (clj)source (cljs)raw docstring

Euler-anglesclj/s

source (clj)source (cljs)

Euler-Lagrange-operatorclj/s≠

clj
(Euler-Lagrange-operator L)
cljs
source (clj)source (cljs)

evolutionclj/s≠

clj
(evolution order)

We can use the coordinatized vector field to build an evolution along an integral curve.

We can use the coordinatized vector field to build an evolution along an
integral curve.
cljs
source (clj)source (cljs)raw docstring

evolveclj/s≠

clj
(evolve state-derivative & state-derivative-args)

evolve takes a state derivative function constructor and its arguments, and returns an integrator via make-integrator.

In particular, the returned function accepts a callback function which will be invoked at intermediate grid points of the integration.

evolve takes a state derivative function constructor and its arguments, and
returns an integrator via make-integrator.

In particular, the returned function accepts a callback function which will be
invoked at intermediate grid points of the integration.
cljs
source (clj)source (cljs)raw docstring

exact-divideclj/s≠multimethod

clj
(exact-divide a b)

generic exact-divide.

Similar to the binary case of /, but throws if the ([[value/exact?]] <result>) returns false.

generic exact-divide.

Similar to the binary case of [[/]], but throws if the `([[value/exact?]]
  <result>)` returns false. 
cljs
source (clj)source (cljs)raw docstring

exact?clj/s≠

clj
(exact? this)
cljs
source

expclj/s≠multimethod

clj
(exp a)

generic exp.

Returns the base-e exponential of x. Equivalent to (expt e x), given some properly-defined e symbol.

generic exp.

Returns the base-e exponential of `x`. Equivalent to `(expt e x)`, given
  some properly-defined `e` symbol.
cljs
source (clj)source (cljs)raw docstring

exp10clj/s≠multimethod

clj
(exp10 a)

generic exp10.

Returns the base-10 exponential of x. Equivalent to (expt 10 x).

generic exp10.

Returns the base-10 exponential of `x`. Equivalent to `(expt 10 x)`.
cljs
source (clj)source (cljs)raw docstring

exp2clj/s≠multimethod

clj
(exp2 a)

generic exp2.

Returns the base-2 exponential of x. Equivalent to (expt 2 x).

generic exp2.

Returns the base-2 exponential of `x`. Equivalent to `(expt 2 x)`.
cljs
source (clj)source (cljs)raw docstring

exptclj/s≠multimethod

clj
(expt a b)

generic expt

generic expt
cljs
source (clj)source (cljs)raw docstring

F->Cclj/s≠

clj
(F->C F)

Accepts a coordinate transformation F from a local tuple to a new coordinate structure, and returns a function from local -> local that applies the transformation directly.

F->C handles local tuples of arbitrary length.

Accepts a coordinate transformation `F` from a local tuple to a new coordinate
structure, and returns a function from `local -> local` that applies the
transformation directly.

[[F->C]] handles local tuples of arbitrary length.
cljs
source (clj)source (cljs)raw docstring

F->CTclj/s≠

clj
(F->CT F)

A transformation of configuration coordinates F to a procedure implementing a transformation of phase-space coordinates (p. 320)

A transformation of configuration coordinates F to a procedure
implementing a transformation of phase-space coordinates (p. 320)
cljs
source (clj)source (cljs)raw docstring

factorialclj/s≠

clj
(factorial n)

Returns the factorial of n, ie, the product of 1 to n (inclusive).

Returns the factorial of `n`, ie, the product of 1 to `n` (inclusive).
cljs
source (clj)source (cljs)raw docstring

find-pathclj/s≠

clj
(find-path Lagrangian t0 q0 t1 q1 n & {:keys [observe]})

SICM p. 23. The optional parameter values is a callback which will report intermediate points of the minimization.

SICM p. 23. The optional parameter values is a callback which will report
intermediate points of the minimization.
cljs
source (clj)source (cljs)raw docstring

floorclj/s≠multimethod

clj
(floor a)

generic floor.

Returns the largest integer less than or equal to a.

Extensions beyond real numbers may behave differently; see the Documentation site for more detail.

generic floor.

Returns the largest integer less than or equal to `a`.

  Extensions beyond real numbers may behave differently; see the [Documentation
  site](https://cljdoc.org/d/sicmutils/sicmutils/CURRENT/doc/basics/generics)
  for more detail.
cljs
source (clj)source (cljs)raw docstring

form-field->form-field-over-mapclj/s≠

clj
(form-field->form-field-over-map mu:N->M)
cljs
source (clj)source (cljs)

fractional-partclj/s≠multimethod

clj
(fractional-part a)

generic fractional-part.

Returns the fractional part of the given value, defined as x - ⌊x⌋.

For positive numbers, this is identical to (- a ([[integer-part]] a)). For negative a, because floor truncates toward negative infinity, you might be surprised to find that fractional-part returns the distance between a and the next-lowest integer:

(= 0.6 (g/fractional-part -0.4))
generic fractional-part.

Returns the fractional part of the given value, defined as `x - ⌊x⌋`.

  For positive numbers, this is identical to `(- a ([[integer-part]] a))`. For
  negative `a`, because [[floor]] truncates toward negative infinity, you might
  be surprised to find that [[fractional-part]] returns the distance between `a`
  and the next-lowest integer:

```clojure
(= 0.6 (g/fractional-part -0.4))
```
cljs
source (clj)source (cljs)raw docstring

freezeclj/s≠

clj
(freeze this)

Freezing an expression means removing wrappers and other metadata from subexpressions, so that the result is basically a pure S-expression with the same structure as the input. Doing this will rob an expression of useful information for further computation; so this is intended to be done just before simplification and printing, to simplify those processes.

Freezing an expression means removing wrappers and other metadata from
subexpressions, so that the result is basically a pure S-expression with the
same structure as the input. Doing this will rob an expression of useful
information for further computation; so this is intended to be done just
before simplification and printing, to simplify those processes.
cljs
sourceraw docstring

Gammaclj/s≠

clj
(Gamma q)
(Gamma q n)

Gamma takes a path function (from time to coordinates) to a state function (from time to local tuple).

Gamma takes a path function (from time to coordinates) to a state
function (from time to local tuple).
cljs
source (clj)source (cljs)raw docstring

Gamma-barclj/s≠

clj
(Gamma-bar f)
cljs
source (clj)source (cljs)

gcdclj/s≠multimethod

clj
(gcd a b)

generic gcd.

Returns the greatest common divisor of the two inputs a and b.

generic gcd.

Returns the [greatest common
  divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) of the two
  inputs `a` and `b`.
cljs
source (clj)source (cljs)raw docstring

golden-section-maxclj/s≠

clj
(golden-section-max f xa xb)
(golden-section-max f xa xb opts)

For convenience, we also provide the sister-procedure for finding the maximum of a unimodal function using the golden section method.

Negate the function, minimize, negate the result.

For convenience, we also provide the sister-procedure for finding
the maximum of a unimodal function using the golden section method.

Negate the function, minimize, negate the result.
cljs
source (clj)source (cljs)raw docstring

golden-section-minclj/s≠

clj
(golden-section-min f xa xb)
(golden-section-min f
                    xa
                    xb
                    {:keys [choose callback]
                     :or {choose best-of callback (constantly nil)}
                     :as opts})

Golden Section search attempts to locate the minimum of the supplied function f by evaluating points located at golden-ratioed intervals between the two starting endpoints a and b. This method is slow, steady and reliable.

Supports the following optional keyword arguments:

:converged? is an optional predicate accepting five arguments:

  • [a fa]
  • [l fl]
  • [r fr]
  • [b fb]
  • current-iteration

If the supplied fn returns true, it will signal convergence and the optimizer will return. Returning false will continue.

:choose is called at the final step of optimization with all 4 points and their fn values (see the first four arguments to :converged?), and returns the final choice.

:callback receives all 5 arguments on every iteration.

:maxiter Maximum number of iterations allowed for the minimizer. Defaults to 1000.

:maxfun Maximum number of times the function can be evaluated before exiting. Defaults to 1000.

:fn-tolerance check that the minimal value of any of the checked points is within the maximum of f(a) or f(b).

:arg-tolerance check that a and b are within this supplied absolute distance.

Golden Section search attempts to locate the minimum of the supplied function
`f` by evaluating points located at golden-ratioed intervals between the two
starting endpoints `a` and `b`. This method is slow, steady and reliable.

Supports the following optional keyword arguments:

`:converged?` is an optional predicate accepting five arguments:

- `[a fa]`
- `[l fl]`
- `[r fr]`
- `[b fb]`
- `current-iteration`

If the supplied `fn` returns true, it will signal convergence and the
optimizer will return. Returning false will continue.

`:choose` is called at the final step of optimization with all 4 points and
their fn values (see the first four arguments to `:converged?`), and returns
the final choice.

`:callback` receives all 5 arguments on every iteration.

`:maxiter` Maximum number of iterations allowed for the minimizer. Defaults to
1000.

`:maxfun` Maximum number of times the function can be evaluated before exiting.
Defaults to 1000.

`:fn-tolerance` check that the minimal value of any of the checked points is
within the maximum of f(a) or f(b).

`:arg-tolerance` check that `a` and `b` are within this supplied absolute
distance.
cljs
source (clj)source (cljs)raw docstring

Gradclj/s≠

clj

Operator that takes a function f and returns a new function that calculates the Gradient of f.

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

Operator that takes a function `f` and returns a new function that
calculates the [Gradient](https://en.wikipedia.org/wiki/Gradient) of `f`.

The related [[D]] operator returns a function that produces a structure of the
opposite orientation as [[Grad]]. Both of these functions use forward-mode
automatic differentiation.
source (clj)source (cljs)raw docstring

Hamilton-equationsclj/s≠

clj
(Hamilton-equations Hamiltonian)
cljs
source (clj)source (cljs)

Hamiltonianclj/s≠

clj
(Hamiltonian & n)

Return SICM-style function signature for a Hamiltonian with n degrees of freedom (or 1 if n is not given). Useful for constructing Hamiltonian literal functions.

Return SICM-style function signature for a Hamiltonian with n
degrees of freedom (or 1 if n is not given). Useful for constructing
Hamiltonian literal functions.
cljs
source (clj)source (cljs)raw docstring

Hamiltonian->state-derivativeclj/s≠

clj
(Hamiltonian->state-derivative Hamiltonian)
cljs
source (clj)source (cljs)

Iclj/s≠

clj

Identity function. Returns its argument.

Identity function. Returns its argument.
source (clj)source (cljs)raw docstring

identity-likeclj/s≠

clj
(identity-like this)
cljs
source

identity?clj/s≠

clj
(identity? this)
cljs
source

imag-partclj/s≠multimethod

clj
(imag-part a)

generic imag-part

generic imag-part
cljs
source (clj)source (cljs)raw docstring

inner-productclj/s≠multimethod

clj
(inner-product a b)

generic inner-product

generic inner-product
cljs
source (clj)source (cljs)raw docstring

integer-partclj/s≠multimethod

clj
(integer-part a)

generic integer-part.

Returns the integer part of a by removing any fractional digits.

generic integer-part.

Returns the integer part of `a` by removing any fractional digits.
cljs
source (clj)source (cljs)raw docstring

integrate-state-derivativeclj/s≠

clj
(integrate-state-derivative state-derivative
                            state-derivative-args
                            initial-state
                            t1
                            dt)

A wrapper for evolve, which is more convenient when you just want a vector of (time, state) pairs over the integration interval instead of having to deal with a callback. Integrates the supplied state derivative (and its argument package) from [0 to t1] in steps of size dt

A wrapper for evolve, which is more convenient when you just
want a vector of (time, state) pairs over the integration interval
instead of having to deal with a callback. Integrates the supplied
state derivative (and its argument package) from [0 to t1] in steps
of size dt
cljs
source (clj)source (cljs)raw docstring

interior-productclj/s≠

clj
(interior-product V)
cljs
source (clj)source (cljs)

invertclj/s≠multimethod

clj
(invert a)

generic invert.

Returns the multiplicative inverse of a.

Equivalent to ([[/]] 1 a).

generic invert.

Returns the multiplicative inverse of `a`.

  Equivalent to `([[/]] 1 a)`.
cljs
source (clj)source (cljs)raw docstring

iterated-mapclj/s≠

clj
(iterated-map f n)

f is a function of (x y continue fail), which calls continue with the values of x' y' that follow x y in the mapping. Returns a map of the same shape that iterates the iterated map n times before invoking the continuation, or invokes the fail continuation if the inner map fails.

f is a function of (x y continue fail), which calls continue with
the values of x' y' that follow x y in the mapping. Returns a map of
the same shape that iterates the iterated map n times before
invoking the continuation, or invokes the fail continuation if the
inner map fails.
cljs
source (clj)source (cljs)raw docstring

Jacobianclj/s≠

clj
(Jacobian to-basis from-basis)

Returns the Jacobian of transition from from-basis to to-basis.

Returns the Jacobian of transition from `from-basis` to `to-basis`.
cljs
source (clj)source (cljs)raw docstring

kindclj/s≠

clj
(kind this)
cljs
source

kind-predicateclj/s≠

clj
(kind-predicate x)

Returns a predicate that returns true if its argument matches the supplied kind-keyword k, false otherwise.

Returns a predicate that returns true if its argument matches the supplied
kind-keyword `k`, false otherwise.
cljs
source (clj)source (cljs)raw docstring

Lagrange-equationsclj/s≠

clj
(Lagrange-equations Lagrangian)
cljs
source (clj)source (cljs)

Lagrange-equations-first-orderclj/s≠

clj
(Lagrange-equations-first-order L)
cljs
source (clj)source (cljs)

Lagrange-interpolation-functionclj/s≠

clj
(Lagrange-interpolation-function ys xs)
cljs
source (clj)source (cljs)

Lagrangian->energyclj/s≠

clj
(Lagrangian->energy L)
cljs
source (clj)source (cljs)

Lagrangian->Hamiltonianclj/s

source (clj)source (cljs)

Lagrangian->state-derivativeclj/s≠

clj
(Lagrangian->state-derivative L)

The state derivative of a Lagrangian is a function carrying a state tuple to its time derivative.

The state derivative of a Lagrangian is a function carrying a state
tuple to its time derivative.
cljs
source (clj)source (cljs)raw docstring

Lagrangian-actionclj/s≠

clj
(Lagrangian-action L q t1 t2)
cljs
source (clj)source (cljs)

Lapclj/s≠

clj

Operator that takes a function f and returns a function that calculates the Vector Laplacian of f at its input point.

Operator that takes a function `f` and returns a function that
calculates the [Vector
Laplacian](https://en.wikipedia.org/wiki/Laplace_operator#Vector_Laplacian) of
`f` at its input point.
source (clj)source (cljs)raw docstring

lcmclj/s≠multimethod

clj
(lcm a b)

generic lcm.

Returns the least common multiple of the two inputs a and b.

generic lcm.

Returns the [least common
  multiple](https://en.wikipedia.org/wiki/Least_common_multiple) of the two
  inputs `a` and `b`.
cljs
source (clj)source (cljs)raw docstring

Legendre-transformclj/s

source (clj)source (cljs)

let-coordinatesclj/smacro

(let-coordinates & args)
source

Lie-derivativeclj/s≠multimethod

clj
(Lie-derivative a)

generic Lie-derivative

generic Lie-derivative
cljs
source (clj)source (cljs)raw docstring

Lie-transformclj/s≠

clj
(Lie-transform H t)

p. 428

p. 428
cljs
source (clj)source (cljs)raw docstring

linear-interpolantsclj/s≠

clj
(linear-interpolants x0 x1 n)
cljs
source (clj)source (cljs)

literal-downclj/s≠

clj
(literal-down sym size)

Generates a down structure of dimension size populated by symbolic entries, each prefixed by the supplied symbol sym.

For example:

(= (literal-down 'x 3)
   (down 'x_0 'x_1 'x_2))
Generates a `down` structure of dimension `size` populated by symbolic entries,
each prefixed by the supplied symbol `sym`.

For example:

```clojure
(= (literal-down 'x 3)
   (down 'x_0 'x_1 'x_2))
```
cljs
source (clj)source (cljs)raw docstring

literal-functionclj/smacro

(literal-function f)
(literal-function f sicm-signature)
(literal-function f domain range)
source

literal-manifold-functionclj/s≠

clj
(literal-manifold-function name coordinate-system)
cljs
source (clj)source (cljs)

literal-manifold-mapclj/s≠

clj
(literal-manifold-map name source target)
cljs
source (clj)source (cljs)

literal-matrixclj/s≠

clj
(literal-matrix sym nrows ncols)

Generates a nrows x ncols matrix of symbolic entries, each prefixed by the supplied symbol sym.

NOTE: The symbols in the returned matrix record their Einstein-notation path into the structure that this matrix represents; a down of up columns. This means that the returned indices embedded in the symbols look flipped, ji vs ij.

For example:

(= (literal-matrix 'x 2 2)
   (by-rows ['x_0↑0 'x_1↑0]
            ['x_0↑1 'x_1↑1]))
Generates a `nrows` x `ncols` matrix of symbolic entries, each prefixed by
the supplied symbol `sym`.

NOTE: The symbols in the returned matrix record their Einstein-notation path
into the structure that this matrix represents; a `down` of `up` columns. This
means that the returned indices embedded in the symbols look flipped, `ji` vs
`ij`.

For example:

```clojure
(= (literal-matrix 'x 2 2)
   (by-rows ['x_0↑0 'x_1↑0]
            ['x_0↑1 'x_1↑1]))
```
cljs
source (clj)source (cljs)raw docstring

literal-numberclj/s≠

clj
(literal-number x)

Returns its argument, wrapped in a marker type that responds to the generic operations registered in sicmutils.numsymb.

Symbols are automatically treated as literal-number instances, so

(* 10 (literal-number 'x))

is equivalent to

(* 10 'x)

If you pass an actual number, sicmutils will attempt to preserve exact values through various operations:

(g/+ 1 (g/cos (g/* 2 (literal-number 4))))
;;=> (+ 1 (cos 8))

Notice that the (g/* 2 ...) is evaluated, but cos evaluation is deferred, since the result is inexact. On the other hand, if the number is inexact to begin with:

(g/+ 1 (g/cos (g/* 2 (literal-number 2.2))))
;;=> 0.6926671300215806

the system will go ahead and evaluate it.

Returns its argument, wrapped in a marker type that responds to the generic
operations registered in [[sicmutils.numsymb]].

Symbols are automatically treated as [[literal-number]] instances, so

```clojure
(* 10 (literal-number 'x))
```

is equivalent to

```clojure
(* 10 'x)
```

If you pass an actual number, sicmutils will attempt to preserve exact values
through various operations:

```clojure
(g/+ 1 (g/cos (g/* 2 (literal-number 4))))
;;=> (+ 1 (cos 8))
```

Notice that the `(g/* 2 ...)` is evaluated, but `cos` evaluation is deferred,
since the result is inexact. On the other hand, if the number is inexact to
begin with:

```clojure
(g/+ 1 (g/cos (g/* 2 (literal-number 2.2))))
;;=> 0.6926671300215806
```

the system will go ahead and evaluate it.
cljs
source (clj)source (cljs)raw docstring

literal-oneform-fieldclj/s≠

clj
(literal-oneform-field name coordinate-system)
cljs
source (clj)source (cljs)

literal-upclj/s≠

clj
(literal-up sym size)

Generates an up structure of dimension size populated by symbolic entries, each prefixed by the supplied symbol sym.

For example:

(= (literal-up 'x 3)
   (up 'x↑0 'x↑1 'x↑2))
Generates an `up` structure of dimension `size` populated by symbolic entries,
each prefixed by the supplied symbol `sym`.

For example:

```clojure
(= (literal-up 'x 3)
   (up 'x↑0 'x↑1 'x↑2))
```
cljs
source (clj)source (cljs)raw docstring

literal-vector-fieldclj/s≠

clj
(literal-vector-field name coordinate-system)
cljs
source (clj)source (cljs)

logclj/s≠multimethod

clj
(log a)

generic log.

Returns the natural logarithm of x.

generic log.

Returns the natural logarithm of `x`.
cljs
source (clj)source (cljs)raw docstring

log10clj/s≠multimethod

clj
(log10 a)

generic log10.

Returns the base-10 logarithm of x, ie, $log_10(x)$.

generic log10.

Returns the base-10 logarithm of `x`, ie, $log_10(x)$.
cljs
source (clj)source (cljs)raw docstring

log2clj/s≠multimethod

clj
(log2 a)

generic log2.

Returns the base-2 logarithm of x, ie, $log_2(x)$.

generic log2.

Returns the base-2 logarithm of `x`, ie, $log_2(x)$.
cljs
source (clj)source (cljs)raw docstring

m->sclj/s≠

clj
(m->s ls m rs)

Convert the matrix m into a structure S, guided by the requirement that (* ls S rs) should be a scalar.

Convert the matrix `m` into a structure `S`, guided by the requirement that `(*
ls S rs)` should be a scalar.
cljs
source (clj)source (cljs)raw docstring

m:generateclj/s≠

clj
(m:generate r c f)

Returns a matrix with r rows and c columns, whose entries are generated by the supplied function f.

The entry in the ith row and j-th column is (f i j).

Returns a matrix with `r` rows and `c` columns, whose entries are generated by
the supplied function `f`.

The entry in the `i`th row and `j`-th column is `(f i j)`.
cljs
source (clj)source (cljs)raw docstring

magnitudeclj/s≠multimethod

clj
(magnitude a)

generic magnitude

generic magnitude
cljs
source (clj)source (cljs)raw docstring

make-Christoffelclj/s≠

clj
(make-Christoffel symbols basis)
cljs
source (clj)source (cljs)

make-polarclj/s≠multimethod

clj
(make-polar a b)

generic make-polar

generic make-polar
cljs
source (clj)source (cljs)raw docstring

make-rectangularclj/s≠multimethod

clj
(make-rectangular a b)

generic make-rectangular

generic make-rectangular
cljs
source (clj)source (cljs)raw docstring

maprclj/s≠

clj
(mapr f & structures)

Return a structure with the same shape as s but with f applied to each primitive (that is, not structural) component.

Return a structure with the same shape as s but with f applied to each
primitive (that is, not structural) component.
cljs
source (clj)source (cljs)raw docstring

matrix-by-colsclj/s≠

clj
(matrix-by-cols & cols)

Returns a matrix whose columns consist of the supplied sequence of cols. These all must be the same length.

Variadic equivalent to [[by-cols*]].

Returns a matrix whose columns consist of the supplied sequence of `cols`.
These all must be the same length.

Variadic equivalent to [[by-cols*]].
cljs
source (clj)source (cljs)raw docstring

matrix-by-rowsclj/s≠

clj
(matrix-by-rows & rows)

Returns a matrix whose rows consist of the supplied sequence of rows. These all must be the same length.

Variadic equivalent to [[by-rows*]].

Returns a matrix whose rows consist of the supplied sequence of `rows`. These
all must be the same length.

Variadic equivalent to [[by-rows*]].
cljs
source (clj)source (cljs)raw docstring

minimizeclj/s≠

clj
(minimize f a b)
(minimize f a b observe)

Find the minimum of the function f: R -> R in the interval [a, b].

If an observe function is supplied, it will be invoked with the iteration count and the values of x and f(x) at each search step.

Find the minimum of the function `f: R -> R` in the interval `[a, b]`.

If an `observe` function is supplied, it will be invoked with the iteration
count and the values of x and f(x) at each search step.
cljs
source (clj)source (cljs)raw docstring

moduloclj/s≠multimethod

clj
(modulo a b)

generic modulo.

Returns the result of the mathematical Modulo operation between a and b (using the Knuth definition listed).

The contract satisfied by modulo is:

(= a (+ (* b ([[floor]] (/ a b)))
        ([[modulo]] a b)))

For numbers, this differs from the contract offered by remainder because ([[floor]] (/ a b)) rounds toward negative infinity, while the quotient operation in the contract for remainder rounds toward 0.

The result will be either 0 or of the same sign as the divisor b.

generic modulo.

Returns the result of the
  mathematical [Modulo](https://en.wikipedia.org/wiki/Modulo_operation)
  operation between `a` and `b` (using the Knuth definition listed).

 The contract satisfied by [[modulo]] is:

```clojure
(= a (+ (* b ([[floor]] (/ a b)))
        ([[modulo]] a b)))
```

 For numbers, this differs from the contract offered by [[remainder]]
 because `([[floor]] (/ a b))` rounds toward negative infinity, while
 the [[quotient]] operation in the contract for [[remainder]] rounds toward 0.

 The result will be either `0` or of the same sign as the divisor `b`.
cljs
source (clj)source (cljs)raw docstring

momentumclj/s≠

clj
(momentum H-state)

See coordinate: this returns the momentum element of a Hammilton state tuple (by convention, the element at index 2).

See coordinate: this returns the momentum element of a
Hammilton state tuple (by convention, the element at index 2).
cljs
source (clj)source (cljs)raw docstring

momentum-tupleclj/s

source (clj)source (cljs)

multidimensional-minimizeclj/s≠

clj
(multidimensional-minimize func x0 & {:keys [info?] :as opts})

Entrypoint for multidimensional minimization routines.

See sicmutils.numerical.multimin.nelder-mead/nelder-mead for the only supported option.

Entrypoint for multidimensional minimization routines.

See [[sicmutils.numerical.multimin.nelder-mead/nelder-mead]] for the only
supported option.
cljs
source (clj)source (cljs)raw docstring

negateclj/s≠multimethod

clj
(negate a)

generic negate.

Returns the negation of a.

Equivalent to ([[-]] ([[value/zero-like]] a) a).

generic negate.

Returns the negation of `a`.

  Equivalent to `([[-]] ([[value/zero-like]] a) a)`.
cljs
source (clj)source (cljs)raw docstring

negative?clj/s≠multimethod

clj
(negative? a)

generic negative?.

Returns true if the argument a is less than ([[value/zero-like]] a), false otherwise. The default implementation depends on a proper Comparable implementation on the type.`

generic negative?.

Returns true if the argument `a` is less than `([[value/zero-like]] a)`,
  false otherwise. The default implementation depends on a proper Comparable
  implementation on the type.`
cljs
source (clj)source (cljs)raw docstring

nelder-meadclj/s≠

clj
(nelder-mead func x0 {:keys [callback] :as opts})

Find the minimum of the function f: R^n -> R, given an initial point q ∈ R^n. Supports the following optional keyword arguments:

:callback if supplied, the supplied fn will be invoked with iteration count, the values of X and the value of f(X) at each intermediate point of evaluation.

:info? if true, wraps the result with evaluation information.

:adaptive? if true, the Nelder-Mead parameters for contraction, expansion, reflection and shrinking will be set adaptively, as functions of the number of dimensions. If false they stay constant.

:alpha sets the reflection coefficient used for each step of Nelder-Mead.

:beta sets the expansion coefficient used for each step of Nelder-Mead.

:gamma sets the contraction coefficient used for each step of Nelder-Mead.

:sigma sets the shrink coefficient used for each step of Nelder-Mead.

:maxiter Maximum number of iterations allowed for the minimizer. Defaults to 200*dimension.

:maxfun Maximum number of times the function can be evaluated before exiting. Defaults to 200*dimension.

:simplex-tolerance When the absolute value of the max difference between the best point and any point in the simplex falls below this tolerance, the minimizer stops. Defaults to 1e-4.

:fn-tolerance When the absolute value of the max difference between the best point's function value and the fn value of any point in the simplex falls below this tolerance, the minimizer stops. Defaults to 1e-4.

:zero-delta controls the value to which 0 entries in the initial vector are set during initial simplex generation. Defaults to 0.00025.

:nonzero-delta factor by which entries in the initial vector are perturbed to generate the initial simplex. Defaults to 0.05.

See Gao, F. and Han, L. Implementing the Nelder-Mead simplex algorithm with adaptive parameters. 2012. Computational Optimization and Applications. 51:1, pp. 259-277 I gratefully acknowledge the Python implementation in SciPy which I have imitated here.

Find the minimum of the function f: R^n -> R, given an initial point q ∈ R^n.
Supports the following optional keyword arguments:

`:callback` if supplied, the supplied fn will be invoked with iteration count,
the values of X and the value of f(X) at each intermediate point of
evaluation.

`:info?` if true, wraps the result with evaluation information.

`:adaptive?` if true, the Nelder-Mead parameters for contraction, expansion,
reflection and shrinking will be set adaptively, as functions of the number of
dimensions. If false they stay constant.

`:alpha` sets the reflection coefficient used for each step of Nelder-Mead.

`:beta` sets the expansion coefficient used for each step of Nelder-Mead.

`:gamma` sets the contraction coefficient used for each step of Nelder-Mead.

`:sigma` sets the shrink coefficient used for each step of Nelder-Mead.

`:maxiter` Maximum number of iterations allowed for the minimizer. Defaults to
200*dimension.

`:maxfun` Maximum number of times the function can be evaluated before exiting.
Defaults to 200*dimension.

`:simplex-tolerance` When the absolute value of the max difference between the
best point and any point in the simplex falls below this tolerance, the
minimizer stops. Defaults to 1e-4.

`:fn-tolerance` When the absolute value of the max difference between the best
point's function value and the fn value of any point in the simplex falls
below this tolerance, the minimizer stops. Defaults to 1e-4.

`:zero-delta` controls the value to which 0 entries in the initial vector are
set during initial simplex generation. Defaults to 0.00025.

`:nonzero-delta` factor by which entries in the initial vector are perturbed to
generate the initial simplex. Defaults to 0.05.

See Gao, F. and Han, L.
    Implementing the Nelder-Mead simplex algorithm with adaptive
    parameters. 2012. Computational Optimization and Applications.
    51:1, pp. 259-277
I gratefully acknowledge the [Python implementation in
SciPy](https://github.com/scipy/scipy/blob/589c9afe41774ee96ec121f1867361146add8276/scipy/optimize/optimize.py#L556:5)
which I have imitated here.
cljs
source (clj)source (cljs)raw docstring

numerical?clj/s≠

clj
(numerical? _)
cljs
source

one-likeclj/s≠

clj
(one-like this)
cljs
source

one?clj/s≠

clj
(one? this)
cljs
source

orientationclj/s≠

clj
(orientation s)

Returns the orientation of s, either ::up or ::down. Defaults to ::up, even for non-structures.

Returns the orientation of `s`, either `::up` or `::down`. Defaults to `::up`,
even for non-structures.
cljs
source (clj)source (cljs)raw docstring

osculating-pathclj/s≠

clj
(osculating-path state0)

Given a state tuple (of finite length), reconstitutes the initial segment of the Taylor series corresponding to the state tuple data as a function of t. Time is measured beginning at the point of time specified in the input state tuple.

Given a state tuple (of finite length), reconstitutes the initial
segment of the Taylor series corresponding to the state tuple data
as a function of t.  Time is measured beginning at the point of time
specified in the input state tuple.
cljs
source (clj)source (cljs)raw docstring

outer-productclj/s≠multimethod

clj
(outer-product a b)

generic outer-product

generic outer-product
cljs
source (clj)source (cljs)raw docstring

p->rclj/s≠

clj
(p->r [_ [r φ]])

SICM p. 47. Polar to rectangular coordinates of state.

SICM p. 47. Polar to rectangular coordinates of state.
cljs
source (clj)source (cljs)raw docstring

partialclj/s

(partial & selectors)

A shim. Dispatches to [[d/partial]] when all the arguments are integers; falls back to [[clojure.core/partial]] (partial function application) otherwise.

A shim. Dispatches to [[d/partial]] when all the arguments are integers; falls
back to [[clojure.core/partial]] (partial function application) otherwise.
sourceraw docstring

partial-derivativeclj/s≠multimethod

clj
(partial-derivative a b)

generic partial-derivative

generic partial-derivative
cljs
source (clj)source (cljs)raw docstring

partial-sumsclj/s≠

clj
(partial-sums s)

Returns a series (of the same type as the input) of partial sums of the terms in the supplied series s.

Returns a series (of the same type as the input) of partial sums of the terms
in the supplied series `s`.
cljs
source (clj)source (cljs)raw docstring

piclj/s

The mathematical constant Pi.

The mathematical constant [Pi](https://en.wikipedia.org/wiki/Pi).
sourceraw docstring

pointclj/s≠

clj
(point coordinate-system)
cljs
source (clj)source (cljs)

Poisson-bracketclj/s≠

clj
(Poisson-bracket f g)
cljs
source (clj)source (cljs)

polar-canonicalclj/s≠

clj
(polar-canonical alpha)

p.327

p.327
cljs
source (clj)source (cljs)raw docstring

power-seriesclj/s≠

clj
(power-series & prefix)

Return a [[PowerSeries]] starting with the supplied values. The remainder of the series will be filled with the zero-value corresponding to the first of the given values.

If you have a sequence already, prefer [[power-series*]].

Return a [[PowerSeries]] starting with the supplied values. The remainder of
the series will be filled with the zero-value corresponding to the first of
the given values.

If you have a sequence already, prefer [[power-series*]].
cljs
source (clj)source (cljs)raw docstring

principal-valueclj/s≠

clj
(principal-value cuthigh)
cljs
source (clj)source (cljs)

clj
(print-expression expr)
cljs
source (clj)source (cljs)

pullbackclj/s≠

clj
(pullback mu:N->M)
(pullback mu:N->M mu-inverse:M->N)
cljs
source (clj)source (cljs)

pushforward-vectorclj/s≠

clj
(pushforward-vector mu:N->M mu-inverse:M->N)
cljs
source (clj)source (cljs)

qp-submatrixclj/s≠

clj
(qp-submatrix m)
cljs
source (clj)source (cljs)

quotientclj/s≠multimethod

clj
(quotient a b)

generic quotient

generic quotient
cljs
source (clj)source (cljs)raw docstring

real-partclj/s≠multimethod

clj
(real-part a)

generic real-part

generic real-part
cljs
source (clj)source (cljs)raw docstring

refclj/s

(ref a)
(ref a & ks)

A shim so that ref can act like nth in SICM contexts, as clojure core ref elsewhere.

A shim so that ref can act like nth in SICM contexts, as clojure core ref
elsewhere.
sourceraw docstring

remainderclj/s≠multimethod

clj
(remainder a b)

generic remainder.

Returns the remainder of dividing the dividend a by divisor b.

The contract satisfied by remainder is:

(= a (+ (* b ([[quotient]] a b))
        ([[remainder]] a b)))

For numbers, this differs from the contract offered by modulo because quotient rounds toward 0, while ([[floor]] (/ a b)) rounds toward negative infinity.

The result will be either 0 or of the same sign as the dividend a.

generic remainder.

Returns the remainder of dividing the dividend `a` by divisor `b`.

 The contract satisfied by [[remainder]] is:

```clojure
(= a (+ (* b ([[quotient]] a b))
        ([[remainder]] a b)))
```

 For numbers, this differs from the contract offered by [[modulo]]
 because [[quotient]] rounds toward 0, while `([[floor]] (/ a b))` rounds toward
 negative infinity.

 The result will be either `0` or of the same sign as the dividend `a`.
cljs
source (clj)source (cljs)raw docstring

row-matrixclj/s≠

clj
(row-matrix & xs)

Returns a row matrix populated by the supplied xs. Variadic equivalent to [[row*]].

Returns a row matrix populated by the supplied `xs`. Variadic equivalent
to [[row*]].
cljs
source (clj)source (cljs)raw docstring

row-matrix->downclj/s≠

clj
(row-matrix->down m)

Returns the single row from the supplied row matrix as a down. Errors if some other type is supplied.

Returns the single row from the supplied row matrix as a `down`. Errors if some
other type is supplied.
cljs
source (clj)source (cljs)raw docstring

row-matrix->vectorclj/s≠

clj
(row-matrix->vector m)

Returns the single row from the supplied row matrix as a vector. Errors if some other type is supplied.

Returns the single row from the supplied row matrix as a vector. Errors if some
other type is supplied.
cljs
source (clj)source (cljs)raw docstring

Rxclj/s≠

clj
(Rx α)

Returns a function which rotates a vector α radians about the x axis.

Returns a function which rotates a vector α radians about the x axis.
cljs
source (clj)source (cljs)raw docstring

Ryclj/s≠

clj
(Ry α)

Returns a function which rotates a vector α radians about the y axis.

Returns a function which rotates a vector α radians about the y axis.
cljs
source (clj)source (cljs)raw docstring

Rzclj/s≠

clj
(Rz α)

Returns a function which rotates a vector α radians about the z axis.

Returns a function which rotates a vector α radians about the z axis.
cljs
source (clj)source (cljs)raw docstring

s->mclj/s≠

clj
(s->m ls ms rs)

Convert the structure ms, which would be a scalar if the (compatible) multiplication(* ls ms rs) were performed, to a matrix.

Convert the structure `ms`, which would be a scalar if the (compatible)
multiplication`(* ls ms rs)` were performed, to a matrix.
cljs
source (clj)source (cljs)raw docstring

s->rclj/s≠

clj
(s->r [_ [r θ φ] _])

SICM p. 83

SICM p. 83
cljs
source (clj)source (cljs)raw docstring

S2-sphericalclj/s

source (clj)source (cljs)

S2-stereographicclj/s

source (clj)source (cljs)

s:generateclj/s≠

clj
(s:generate dimension orientation f)

Generate a structure with the given orientation whose elements are

(f i)

where i ranges from [0..dimension).

Generate a structure with the given `orientation` whose elements are

(f i)

where i ranges from `[0..dimension)`.
cljs
source (clj)source (cljs)raw docstring

secclj/s≠multimethod

clj
(sec a)

generic sec

generic sec
cljs
source (clj)source (cljs)raw docstring

sechclj/s≠multimethod

clj
(sech a)

generic sech

generic sech
cljs
source (clj)source (cljs)raw docstring

seq:pprintclj/s≠

clj
(seq:pprint n xs)

Realizes, simplifies and pretty-prints n elements from the supplied sequence xs.

Realizes, simplifies and pretty-prints `n` elements from the supplied sequence
`xs`.
cljs
source (clj)source (cljs)raw docstring

seq:printclj/s≠

clj
(seq:print n xs)

Realizes, simplifies and prints n elements from the supplied sequence xs.

Realizes, simplifies and prints `n` elements from the supplied sequence `xs`.
cljs
source (clj)source (cljs)raw docstring

seriesclj/s≠

clj
(series & prefix)

Return a [[Series]] starting with the supplied values. The remainder of the series will be filled with the zero-value corresponding to the first of the given values.

If you have a sequence already, prefer [[series*]].

Return a [[Series]] starting with the supplied values. The remainder of the
series will be filled with the zero-value corresponding to the first of the
given values.

If you have a sequence already, prefer [[series*]].
cljs
source (clj)source (cljs)raw docstring

series:sumclj/s≠

clj
(series:sum s n)

Returns the sum of all elements in the input series s up to order n (inclusive). For example:

(sum (series 1 1 1 1 1 1 1) 3)
;; => 4

NOTE that sum sums the first n + 1 terms, since a series starts with an order 0 term.

Returns the sum of all elements in the input series `s` up to order
`n` (inclusive). For example:

```clojure
(sum (series 1 1 1 1 1 1 1) 3)
;; => 4
```

NOTE that [[sum]] sums the first `n + 1` terms, since a series starts with an
order 0 term.
cljs
source (clj)source (cljs)raw docstring

sicmutils-repl-initclj

(sicmutils-repl-init)
source

simplifyclj/s≠multimethod

clj
(simplify a)

generic simplify

generic simplify
cljs
source (clj)source (cljs)raw docstring

sinclj/s≠multimethod

clj
(sin a)

generic sin

generic sin
cljs
source (clj)source (cljs)raw docstring

sinhclj/s≠multimethod

clj
(sinh a)

generic sinh

generic sinh
cljs
source (clj)source (cljs)raw docstring

sqrtclj/s≠multimethod

clj
(sqrt a)

generic sqrt

generic sqrt
cljs
source (clj)source (cljs)raw docstring

squareclj/s≠multimethod

clj
(square a)

generic square

generic square
cljs
source (clj)source (cljs)raw docstring

standard-mapclj/s≠

clj
(standard-map K)
cljs
source (clj)source (cljs)

state->tclj/s≠

clj
(state->t s)

Extract the time slot from a state tuple.

See coordinate for more detail.

Extract the time slot from a state tuple.

See [[coordinate]] for more detail.
cljs
source (clj)source (cljs)raw docstring

state-advancerclj/s≠

clj
(state-advancer state-derivative & state-derivative-args)

state-advancer takes a state derivative function constructor followed by the arguments to construct it with. The state derivative function is constructed and an integrator is produced which takes:

  • initial state
  • target time

as arguments. Optionally, supply an options map with these optional fields:

:compile?: If true, the ODE solver will compile your state function.

:epsilon: The maximum error tolerance allowed by the ODE solver, both relative and absolute.

Returns the final state.

The state derivative is expected to map a structure to a structure of the same shape, and is required to have the time parameter as the first element.

state-advancer takes a state derivative function constructor followed by the
arguments to construct it with. The state derivative function is constructed
and an integrator is produced which takes:

- initial state
- target time

as arguments. Optionally, supply an options map with these optional fields:

`:compile?`: If true, the ODE solver will compile your state function.

`:epsilon`: The maximum error tolerance allowed by the ODE solver, both
relative and absolute.

Returns the final state.

The state derivative is expected to map a structure to a structure of the same
shape, and is required to have the time parameter as the first element.
cljs
source (clj)source (cljs)raw docstring

structure->vectorclj/s≠

clj
(structure->vector s)

Return the structure s in unoriented vector form.

Return the structure `s` in unoriented vector form.
cljs
source (clj)source (cljs)raw docstring

structure?clj/s≠

clj
(structure? s)

Returns true if s is a structure, false otherwise. (Vectors are treated as up structures.)

Returns `true` if `s` is a structure, false otherwise. (Vectors are treated as
up structures.)
cljs
source (clj)source (cljs)raw docstring

submatrixclj/s≠

clj
(submatrix m lowrow hirow lowcol hicol)

Returns the submatrix of m generated by taking

  • rows from lowrow -> hirow,
  • columns from lowcol -> hicol
Returns the submatrix of `m` generated by taking

- rows from `lowrow` -> `hirow`,
- columns from `lowcol` -> `hicol`
cljs
source (clj)source (cljs)raw docstring

sumclj/s≠

clj
(sum xs)
(sum f low high)

Sums either:

  • a series xs of numbers, or
  • the result of mapping function f to (range low high)

Using Kahan's summation trick behind the scenes to keep floating point errors under control.

Sums either:

- a series `xs` of numbers, or
- the result of mapping function `f` to `(range low high)`

Using Kahan's summation trick behind the scenes to keep floating point errors
under control.
cljs
source (clj)source (cljs)raw docstring

symplectic-transform?clj/s≠

clj
(symplectic-transform? C)

p. 334

p. 334
cljs
source (clj)source (cljs)raw docstring

symplectic-unitclj/s≠

clj
(symplectic-unit n)

p. 334 (used, but not defined there)

p. 334 (used, but not defined there)
cljs
source (clj)source (cljs)raw docstring

tanclj/s≠multimethod

clj
(tan a)

generic tan

generic tan
cljs
source (clj)source (cljs)raw docstring

tanhclj/s≠multimethod

clj
(tanh a)

generic tanh

generic tanh
cljs
source (clj)source (cljs)raw docstring

taylor-seriesclj/s≠

clj
(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)))
```
cljs
source (clj)source (cljs)raw docstring

tex$clj/s

(tex$ expr)

Returns a string containing a LaTeX representation of expr, wrapped in single $ to mark the string as an inline LaTeX form.

Returns a string containing a LaTeX representation of `expr`, wrapped in single
`$` to mark the string as an inline LaTeX form.
sourceraw docstring

tex$$clj/s

(tex$$ expr)

Returns a string containing a LaTeX representation of expr, wrapped in double $$ to mark the string as a block LaTeX form.

Returns a string containing a LaTeX representation of `expr`, wrapped in double
`$$` to mark the string as a block LaTeX form.
sourceraw docstring

time-independent-canonical?clj/s≠

clj
(time-independent-canonical? C)

p.326

p.326
cljs
source (clj)source (cljs)raw docstring

traceclj/s≠multimethod

clj
(trace a)

generic trace

generic trace
cljs
source (clj)source (cljs)raw docstring

transposeclj/s≠multimethod

clj
(transpose a)

generic transpose

generic transpose
cljs
source (clj)source (cljs)raw docstring

upclj/s≠

clj
(up & xs)

Construct an up (contravariant) tuple from the arguments.

Variadic version of [[up*]].

Construct an up (contravariant) tuple from the arguments.

Variadic version of [[up*]].
cljs
source (clj)source (cljs)raw docstring

up->column-matrixclj/s≠

clj
(up->column-matrix v)

Returns a column matrix with the contents of the supplied up structure. Errors if any other type is provided.

Returns a column matrix with the contents of the supplied `up` structure.
Errors if any other type is provided.
cljs
source (clj)source (cljs)raw docstring

up?clj/s≠

clj
(up? s)

Returns true if s is an up structure, false otherwise.

Returns `true` if `s` is an up structure, false otherwise.
cljs
source (clj)source (cljs)raw docstring

using-coordinatesclj/smacro

(using-coordinates & args)
source

v:make-basis-unitclj/s≠

clj
(v:make-basis-unit i)
(v:make-basis-unit n i)

Returns a basis sequence of n 0s, with 1 in the ith position.

If n is not supplied returns an infinite sequence.

Returns a basis sequence of `n` 0s, with `1` in the `i`th position.

If `n` is not supplied returns an infinite sequence.
cljs
source (clj)source (cljs)raw docstring

vector->downclj/s≠

clj
(vector->down v)

Form a down-tuple from a vector.

NOTE that this is an alias of [[down*]] that is more restrictive, in that it only accepts a vector. Use [[down*]] if you'd like to pass an arbitrary sequence. (If you pass a vector to [[down*]]) it will be just as efficient.

Form a down-tuple from a vector.

NOTE that this is an alias of [[down*]] that is more restrictive, in that it
only accepts a vector. Use [[down*]] if you'd like to pass an arbitrary
sequence. (If you pass a vector to [[down*]]) it will be just as efficient.
cljs
source (clj)source (cljs)raw docstring

vector->upclj/s≠

clj
(vector->up v)

Form an up-tuple from a vector.

NOTE that this is an alias of [[up*]] that is more restrictive, in that it only accepts a vector. Use [[up*]] if you'd like to pass an arbitrary sequence. (If you pass a vector to [[up*]]) it will be just as efficient.

Form an up-tuple from a vector.

NOTE that this is an alias of [[up*]] that is more restrictive, in that it
only accepts a vector. Use [[up*]] if you'd like to pass an arbitrary
sequence. (If you pass a vector to [[up*]]) it will be just as efficient.
cljs
source (clj)source (cljs)raw docstring

vector-basis->dualclj/s≠

clj
(vector-basis->dual vector-basis coordinate-system)
cljs
source (clj)source (cljs)

vector-field->componentsclj/s≠

clj
(vector-field->components vf coordinate-system)
cljs
source (clj)source (cljs)

vector-field->vector-field-over-mapclj/s≠

clj
(vector-field->vector-field-over-map mu:N->M)

Defined on FDG p.72.

Defined on FDG p.72.
cljs
source (clj)source (cljs)raw docstring

vector:generateclj/s≠

clj
(vector:generate n f)

Generates a new vector of length n by applying the function f to integers in the range $[0,n)$.

Generates a new vector of length `n` by applying the function `f` to integers
in the range $[0,n)$.
cljs
source (clj)source (cljs)raw docstring

velocityclj/s≠

clj
(velocity local)

Returns the velocity element of a local tuple (by convention, the third element).

See coordinate for more detail.

Returns the velocity element of a local tuple (by convention, the third
element).

See [[coordinate]] for more detail.
cljs
source (clj)source (cljs)raw docstring

velocity-tupleclj/s

source (clj)source (cljs)

wedgeclj/s≠

clj
(wedge & fs)
cljs
source (clj)source (cljs)

with-literal-functionsclj/smacro

(with-literal-functions & args)
source

zero-likeclj/s≠

clj
(zero-like this)
cljs
source

zero?clj/s≠

clj
(zero? this)
cljs
source

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

× close