Is there an equation solver for the shell? For example, I enter input 1000=x^(1.02)
and the shell solves for x.
-
1Symbolic algebra is way too complex for a simple shell utility, I would be surprised if such an equation solver utility existed that is reasonably generic.– countermodeMay 13, 2016 at 9:27
-
2I guess it depends if the question really means shell vs command line. There are command line driven algebra packages for some Linux distributions. For example, keithbriggs.info/Ode.html– EightBitTonyMay 13, 2016 at 9:41
-
1mathomatic en.wikipedia.org/wiki/Mathomatic ...after a copy/paste of your equation followed by "solve x" and "code" (because otherwise i'd need multiple lines here) i see: x = pow(1000.0, (50.0/51.0)); though it's discontinued development (because George died -sigh-) the math it does it still does nicely.– TheophrastusMay 13, 2016 at 22:30
3 Answers
I personally use the qalc
package, it's just perfect for day to day usage:
$ qalc -t "1000=x^(1.02)"
x = 873.32616
The -t
is just to reduce the verbosity of the result.
Mathematica is expensive, but there are several free alternatives.
See https://en.wikipedia.org/wiki/List_of_computer_algebra_systems - many of these are Free Software with BSD or GPL licenses.
If you use Linux, Axiom (or one of its major forks, OpenAxiom), Maxima, and/or Scilab are probably already packaged for whatever Linux distro you use.
BTW, questions like this have come up several times before on various SE sites, so it's worth searching for other answers. For example, see https://askubuntu.com/questions/110913/which-softwares-can-serve-as-mathematica-and-matlab-equivalents
Since that mentions Matlab, it's also necessary to mention GNU Octave. And, of course, R for stats.
Wolfram Mathematica has a command line interface, so you can use it in shell, but it is expensive.