1

How can I solve equations with F#?

For example (just a loose syntax I made up):

define a, b where (a + b = 5) and (a - b = 1)

define c where (c = c / 2)

print a, b, c

I want it to output 3, 2 and 0.

Also, can it do things like define d where d = c + a using solutions from previously defined equations?

Florin Toader
  • 337
  • 1
  • 9
  • 1
    What you need is called **symbolic computations**. Check [this project](http://www.codeproject.com/Articles/87294/Symbolic-Calculation-in-F), it computes derivatives. You may want to take the same approach to make your code work with systems of equations. Also, this question seems to be offtopic. A good question would be if you wrote up your code and had some specific problem. – Be Brave Be Like Ukraine Mar 09 '15 at 16:19
  • 1
    So this is not built in. There are indeed libraries that allow you to do linear algebraic ecuations and differential equations. – Florin Toader Mar 10 '15 at 09:45

0 Answers0