0.0.269 • Published 2 months ago

stemcmicro v0.0.269

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

npm version

STEMCmicro is a Javascript (Typescript) library for symbolic mathematics.

Example

import assert from 'assert';
import { is_rat } from "math-expression-atoms";
import { create_engine, ExprEngine } from "../src/api/index";
import { State, Stepper } from '../src/clojurescript/runtime/Interpreter';
import { Stack } from "../src/env/Stack";

describe("example", function () {
    it("program", function () {
        const lines: string[] = [
            `(+ 1 2 3 4 5)`,
            `(+ 10 (* 5 2))`,
            `(* (+ 10 5) 2)`
        ];
        const sourceText = lines.join('\n');
        const engine: ExprEngine = create_engine({ syntaxKind: ... });
        const { program, errors } = engine.parseModule(sourceText, {});
        assert.strictEqual(errors.length, 0);
        const runner = new Stepper(program);
        runner.run();
        const stack: Stack<State> = runner.getStateStack();
        assert.strictEqual(stack.length, 1);
        const values = stack.top.values;
        assert.strictEqual(values.length, 3);
        assert.strictEqual(engine.renderAsString(values[0], { format: 'Infix' }), "15");
        assert.strictEqual(is_rat(values[0]), true);
        assert.strictEqual(engine.renderAsString(values[1], { format: 'Infix' }), "20");
        assert.strictEqual(is_rat(values[1]), true);
        assert.strictEqual(engine.renderAsString(values[2], { format: 'Infix' }), "30");
        assert.strictEqual(is_rat(values[2]), true);
        engine.release();
    });
});```

## Features

* arbitrary-precision arithmetic
* complex quantities
* geometric algebra
* trigonometric functions
* special functions
* simplification
* expansion
* substitution
* factoring
* symbolic and numeric roots
* units of measure
* hyperreal numbers
* matrices
* derivatives and gradients
* tensors
* booleans
* integrals
* multi-integrals
* open for extension

## Getting Started

Please take a look at the [tutorial](https://github.com/geometryzen/stemcmicro/blob/master/TUTORIAL.md) file.

## Contributing

Please take a look at the [contributing](https://github.com/geometryzen/stemcmicro/blob/master/CONTRIBUTING.md) file.

## References

STEMCmicro is a fork of [Algebrite by Davide Della Casa](https://github.com/davidedc/Algebrite).
The fork adds Geometric Algebra, S.I. Units of Measure, and changes the way that expressions are matched and transformed.  

Algebrite started as a port of [the EigenMath CAS by George Weigt](http://eigenmath.sourceforge.net/Eigenmath.pdf) to TypeScript.
Another fork of EigenMath: [SMIB by Philippe Billet](http://smib.sourceforge.net/).

Another CAS of similar nature is [SymPy](http://www.sympy.org/en/index.html) made in Python.

Three other Javascript CAS are

* [javascript-cas by Anthony Foster](https://github.com/aantthony/javascript-cas) supporting "differentiation, complex numbers, sums, vectors (dot products, cross products, gradient/curl etc)"
* [Coffeequate by Matthew Alger](http://coffeequate.readthedocs.org/) supporting "quadratic and linear equations, simplification of most algebraic expressions, uncertainties propagation, substitutions, variables, constants, and symbolic constants".
* [Algebra.js by Nicole White](http://algebra.js.org) which among other things can build and solve equations via a "chainable" API.
0.0.269

2 months ago

0.0.268

2 months ago

0.0.267

2 months ago

0.0.266

2 months ago

0.0.265

2 months ago

0.0.259

2 months ago

0.0.258

2 months ago

0.0.257

2 months ago

0.0.256

2 months ago

0.0.255

2 months ago

0.0.254

2 months ago

0.0.263

2 months ago

0.0.262

2 months ago

0.0.261

2 months ago

0.0.260

2 months ago

0.0.264

2 months ago

0.0.252

2 months ago

0.0.251

2 months ago

0.0.253

2 months ago

0.0.249

2 months ago

0.0.248

2 months ago

0.0.247

2 months ago

0.0.246

2 months ago

0.0.245

2 months ago

0.0.250

2 months ago

0.0.241

2 months ago

0.0.244

2 months ago

0.0.243

2 months ago

0.0.242

2 months ago

0.0.238

3 months ago

0.0.237

3 months ago

0.0.236

3 months ago

0.0.235

3 months ago

0.0.239

3 months ago

0.0.230

3 months ago

0.0.234

3 months ago

0.0.233

3 months ago

0.0.232

3 months ago

0.0.231

3 months ago

0.0.240

3 months ago

0.0.216

3 months ago

0.0.215

3 months ago

0.0.214

3 months ago

0.0.219

3 months ago

0.0.218

3 months ago

0.0.217

3 months ago

0.0.227

3 months ago

0.0.226

3 months ago

0.0.225

3 months ago

0.0.224

3 months ago

0.0.229

3 months ago

0.0.228

3 months ago

0.0.223

3 months ago

0.0.222

3 months ago

0.0.221

3 months ago

0.0.220

3 months ago

0.0.213

3 months ago

0.0.212

3 months ago

0.0.211

3 months ago

0.0.210

3 months ago

0.0.209

3 months ago

0.0.208

3 months ago

0.0.207

3 months ago

0.0.205

3 months ago

0.0.206

3 months ago

0.0.204

3 months ago

0.0.203

3 months ago

0.0.202

3 months ago

0.0.197

3 months ago

0.0.196

3 months ago

0.0.199

3 months ago

0.0.198

3 months ago

0.0.201

3 months ago

0.0.200

3 months ago

0.0.195

3 months ago

0.0.194

3 months ago

0.0.189

3 months ago

0.0.193

3 months ago

0.0.192

3 months ago

0.0.191

3 months ago

0.0.190

3 months ago

0.0.188

3 months ago

0.0.187

3 months ago

0.0.186

3 months ago

0.0.185

3 months ago

0.0.184

3 months ago

0.0.182

3 months ago

0.0.181

3 months ago

0.0.180

3 months ago

0.0.183

3 months ago

0.0.179

3 months ago

0.0.178

3 months ago

0.0.177

3 months ago

0.0.176

3 months ago

0.0.175

3 months ago