Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript computer algebra system

Tags:

javascript

I am looking for a simple computer algebra system (cas) for JavaScript but I can't find anything with google. I only need basic functionality:

  • simplify expressions to some canonic form. Ability to check if two expressions are the same, i.e., a(x+y) == ax+ay
  • parse mathematical formulas. I want it to be able to read expressions like ax²+4x.
  • solve simple equations etc.

Do you know of such a library?

like image 862
Jonas Avatar asked May 02 '10 12:05

Jonas


People also ask

Is there a list of CAS libraries for JS?

There is a list of more than 7 other CAS libraries for JS at the bottom of their website. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.

What is polynomial JS and Kas?

Polynomial.js by Robert Eisele specifically performs operations on polynomials in the fields: Q, C, Zp and R. (roots/factorisation routines not included). Kas by the Khan Academy's team can simplify and compare expressions and equations.

What are some of the best books on algebraic expressions?

javascript-cas by Anthony Foster supporting "differentiation, complex numbers, sums, vectors (dot products, cross products, gradient/curl etc)" Coffeequate by Matthew Alger supporting "quadratic and linear equations, simplification of most algebraic expressions, uncertainties propagation, substitutions, variables, constants, and symbolic constants"


2 Answers

(I'm answering myself, as the bounty failed to bring attention on this.)

You might want to try this CAS, which has some good functions (although some parts are broken, use the older versions).

like image 122
Giulio Muscarello Avatar answered Sep 20 '22 16:09

Giulio Muscarello


You can try nerdamer

  • simplification
  • factoring
  • expanding
  • custom functions
  • vectors
  • matrices
  • integration
  • differentiation
  • root solver
  • interpolation

//Expanding
var result = nerdamer('a*(x+y)',null,'expand');
document.getElementById('text').innerHTML = '<p>'+result.text()+'</p>';
//Solving equation
var sol = nerdamer.solveEquations('0=x^2+x+a','x');
document.getElementById('text').innerHTML += '<p>'+sol.toString()+'</p>';
<script src="http://nerdamer.com/js/nerdamer.core.js"></script>
<script src="http://nerdamer.com/js/Algebra.js"></script>
<script src="http://nerdamer.com/js/Solve.js"></script>
<div id="text"></div>
like image 25
ArchHaskeller Avatar answered Sep 21 '22 16:09

ArchHaskeller