(evolve {:keys [initial-state] :as opts})
Returns a fragment that uses the supplied derivative function :f'
to evolve
the state value stored in :atom
.
On every time tick, the component will swap a new JS array representing the
flattened state value into :atom
under the :state
key.
Required arguments:
:f'
: a function of a single argument state
that returns the derivative
of state
.
:atom
: atom holding a map with a key :state
populated with
the (potentially structured, unflattened) initial value for :f'
's state
argument
Optional arguments:
:initial-state
: structure in the shape of the state required by :f'
,
used if :f'
is a function that needs to be compiled (ie not a quoted literal
function).
:epsilon
: - :epsilon
: error tolerance passed along
to odex-js. Defaults to 1e-6.
:max-steps
: the maximum number of steps that the ODE solver will take
before erroring out. Defaults to 10000.
Returns a fragment that uses the supplied derivative function `:f'` to evolve the state value stored in `:atom`. On every time tick, the component will swap a new JS array representing the flattened state value into `:atom` under the `:state` key. Required arguments: - `:f'`: a function of a single argument `state` that returns the derivative of `state`. - `:atom`: atom holding a map with a key `:state` populated with the (potentially structured, unflattened) initial value for `:f'`'s `state` argument Optional arguments: - `:initial-state`: structure in the shape of the state required by `:f'`, used if `:f'` is a function that needs to be compiled (ie not a quoted literal function). - `:epsilon`: - `:epsilon`: error tolerance passed along to [odex-js](https://github.com/littleredcomputer/odex-js). Defaults to 1e-6. - `:max-steps`: the maximum number of steps that the ODE solver will take before erroring out. Defaults to 10000.
(evolve-hamiltonian {:keys [H] :as opts})
Returns a fragment that uses the supplied Hamiltonian :H
to evolve the state
value stored in :atom
.
On every time tick, the component will swap a new JS array representing the
flattened state value into :atom
under the :state
key.
Required arguments:
:H
: a function of state
that returns a scalar energy value.
:atom
: atom holding a map with a key :state
populated with
the (potentially structured, unflattened) initial value for :f'
's state
argument
Optional arguments:
:initial-state
: structure in the shape of the state required by :H
.See evolve
for more supported optional arguments.
Returns a fragment that uses the supplied Hamiltonian `:H` to evolve the state value stored in `:atom`. On every time tick, the component will swap a new JS array representing the flattened state value into `:atom` under the `:state` key. Required arguments: - `:H`: a function of `state` that returns a scalar energy value. - `:atom`: atom holding a map with a key `:state` populated with the (potentially structured, unflattened) initial value for `:f'`'s `state` argument Optional arguments: - `:initial-state`: structure in the shape of the state required by `:H`. See [[evolve]] for more supported optional arguments.
(evolve-lagrangian {:keys [L] :as opts})
Returns a fragment that uses the supplied Lagrangian :L
to evolve
the state value stored in :atom
.
On every time tick, the component will swap a new JS array representing the
flattened state value into :atom
under the :state
key.
Required arguments:
:L
: a function of state
that returns a scalar energy value.
:atom
: atom holding a map with a key :state
populated with
the (potentially structured, unflattened) initial value for :f'
's state
argument
Optional arguments:
:initial-state
: structure in the shape of the state required by :L
.See evolve
for more supported optional arguments.
Returns a fragment that uses the supplied Lagrangian `:L` to evolve the state value stored in `:atom`. On every time tick, the component will swap a new JS array representing the flattened state value into `:atom` under the `:state` key. Required arguments: - `:L`: a function of `state` that returns a scalar energy value. - `:atom`: atom holding a map with a key `:state` populated with the (potentially structured, unflattened) initial value for `:f'`'s `state` argument Optional arguments: - `:initial-state`: structure in the shape of the state required by `:L`. See [[evolve]] for more supported optional arguments.
(evolve-routhian {:keys [R] :as opts})
Returns a fragment that uses the supplied Routhian :R
to evolve
the state value stored in :atom
.
On every time tick, the component will swap a new JS array representing the
flattened state value into :atom
under the :state
key.
Required arguments:
:R
: a function of state
that returns a scalar energy value.
:atom
: atom holding a map with a key :state
populated with
the (potentially structured, unflattened) initial value for :f'
's state
argument
Optional arguments:
:initial-state
: structure in the shape of the state required by :R
.See evolve
for more supported optional arguments.
Returns a fragment that uses the supplied Routhian `:R` to evolve the state value stored in `:atom`. On every time tick, the component will swap a new JS array representing the flattened state value into `:atom` under the `:state` key. Required arguments: - `:R`: a function of `state` that returns a scalar energy value. - `:atom`: atom holding a map with a key `:state` populated with the (potentially structured, unflattened) initial value for `:f'`'s `state` argument Optional arguments: - `:initial-state`: structure in the shape of the state required by `:R`. See [[evolve]] for more supported optional arguments.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close