8.15.0.4
1 Introduction
The sicm language defines generic mathematical functions that can operate on a wide variaty of data. For example the following multiplies, adds and applies numbers, symbols, functions and tuples:
Example:
Standard the output will be some internal representation of the data.
Example:
> (+ 4 'a) '(*number* . #hasheq((expression . (+ 4 a))))
Usually it is more interesting to see the result as a list of symbols and numbers. To this end you could set up the repl to automatically print the simplified expressions:
(let ([P (current-print)]) (current-print (λ (a) (P (simplify a)))))
However, some simplifications can take a long time. Functions are opaque to the simplifier, so unless applied to a symbol, the output will not be any more informative.
Representing literal mathematical objects is possible: for example 'f could represent a number, a vector, a function, etc. To make it clear that it represents a function it should be defined with (literal-function 'f). If just the quoted symbol 'f is used the default is to treat it as (literal-number 'f).
All sicm generic functions can work with units. So for example:
Example:
calculates the acceleration due to gravity at sealevel. Important constants such as :G have been predefined.
Solvers for linear equations, linear least square, polynomial roots and other can be found in sicm/solve. Some slightly-nonlinear systems also can also be solved:
Example:
For numeric calculations different tools can be found in sicm/numerics.
Example:
> (multidimensional-minimize (λ (v) (+ (expt (- (ref v 0) 2) 2) (expt (+ (ref v 1) 1) 2))) '(4 3)) '(1.9999956979475337 -1.0000045718674924)
Example: