jiggzson / nerdamer

a symbolic math expression evaluator for javascript
http://www.nerdamer.com
MIT License
514 stars 82 forks source link

Error in basic algebra result #681

Open 28raining opened 1 year ago

28raining commented 1 year ago

Attached image is the result drawn in Latex.

image

Nerdamer should realize that (1/L)/S == 1/(LS).

There are probably easier ways to reproduce this, but here's one way;

nerdamer.setVar('M', 'matrix([-(S*L1)^-1,(S*L1)^-1,1],[(S*L1)^-1,-(S*L1)^-1+(-S*C1),0],[1,0,0])');  
var x = nerdamer('invert(M)');
nerdamer.setVar('XX', x);
var z = nerdamer('matget(XX, 1, 2)');

var ztex = nerdamer.convertToLaTeX(z.text());
output.appendChild(MathJax.tex2svg(ztex.toString()));