You are looking at historical revision 25080 of this page. It may differ significantly from its current revision.
sundials
Description
The Chicken sundials library provides bindings to the solvers from the SUNDIALS library. SUNDIALS (SUite of Nonlinear and DIfferential/ALgebraic equation Solvers) is a collection of solvers for systems of ordinary differential equations and differential-algebraic equations.
The Chicken sundials library provides interfaces to the CVODE and IDA solvers and has been tested with SUNDIALS version 2.4.0.
Library procedures
IDA solver interface
<procedure>(ida-create-solver TSTART TSTOP VARIABLES DERIVATIVES RESIDUAL-MAIN
[RESIDUAL-INIT] [RESIDUAL-EVENT] [ALG-OR-DIFF] [SUPPRESS] [IC] [USER-DATA] [EVENTS] [RELTOL] [ABSTOL])</procedure>
Creates and initializes an object representing a problem to be solved with the IDA solver.
Arguments TSTART and TSTOP are real numbers that represent the beginning and end of the independent variable range.
Arguments VARIABLES and DERIVATIVES must be SRFI-4 f64vector objects that hold respectively the initial values and derivatives of the system variables.
Argument RESIDUAL-MAIN computes the residual function F and must be a procedure of the following form:
(LAMBDA T YY YP RR DATA)
where
- T
- real-valued independent variable
- YY
- SRFI-4 f64vector with current variable values
- YP
- SRFI-4 f64vector with current variable derivatives
- RR
- SRFI-4 f64vector residual vector, which must be set by this procedure
- DATA
- is a user data object (if set)
[procedure] (ida-solve)
[procedure] (ida-yy)
[procedure] (ida-yp)
[procedure] (ida-get-last-order)
[procedure] (ida-get-num-steps)
[procedure] (ida-get-last-step)
Example
(with-server-connection h "localhost" 11211 (let ((foo 4)) (let ((success (set h "foo" foo))) (let ((foo1 (get h "foo"))) (equal? foo foo1)))))
Version History
- 1.0 Initial release
License
Copyright 2011 Ivan Raikov. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.