4 ms·
Are there programming languages which handle equations?
Take for example the equation
U = R * I
In many languages, I have to re-implement this equation according to which values are known and which are not. Something like this pseudocode:
var u = r * i;
...
var r = u / i;
...
var i = u / r;
Are there systems that allow me to only program the equation and compute the missing values depending on what is known? At least for simple algebra with real numbers?
- necovek 3y agoMetafont (and derivatives like Metapost) do that.
- adastra22 3y agoYou are probably looking for a declarative programming language, like Prolog or Curry: https://curry.pages.ps.informatik.uni-kiel.de/curry-lang.org/ https://curry.pages.ps.informatik.uni-kiel.de/curry-lang.org...
- thesuperbigfrog 3y agoMatlab and GNU Octave can do symbolic equation solving: https://docs.octave.org/v8.2.0/Solvers.html https://docs.octave.org/v8.2.0/Solvers.html https://www.youtube.com/watch?v=ZSsuuyISr6Y&t=1s https://www.youtube.com/watch?v=ZSsuuyISr6Y&t=1s Matlab is a nice, but expensive commercial product. GNU Octave is free software (libre and gratis): https://octave.org/download https://octave.org/download
- tornadofart 3y ago"symbolic equation solving" was the term that helped me refine my search. Thanks!
- jacknobody 3y agoScilab is free, reliable and very similar to Matlab. I believe an arm of the French Government is responsible for it. I use an old hp48gx calculator which can convert a program into an algebraic expression. The calculator can be downloaded free. Search for emu48
- tornadofart 3y agoI will definitely look into it!
- seeknotfind 3y agoNot in other comments, so commercial Mathematica can do it. Theorem proving languages such as coq or agda can as well, especially if you're doing really heavy math. Probably pretty soon we could have the machines (LLMs) convert our prompts into code or solve it directly, depending on exactly what needs to be solved.
- clipsy 3y agoBroadly speaking, it sounds like you're looking for a Computer Algebra System; in addition to some of the recommendations other posts have made, Wikipedia provides a list: https://en.wikipedia.org/wiki/List_of_computer_algebra_systems https://en.wikipedia.org/wiki/List_of_computer_algebra_syste...