Equation Solvers for linear mathematical equations

11,523

Solution 1

Solving linear systems can generally be solved using linear programming. I'd recommend taking a look at Boost uBLAS for starters - it has a simple triangular solver. Then you might checkout libraries targeting more domain specific approaches, perhaps QSopt.

Solution 2

You're venturing into the world of numerical analysis, and here be dragons. Seemingly small differences in specification can make a huge difference in what is the right approach.

I hesitate to make specific suggestions without a fairly precise description of the problem domain. It sounds superficiall like you are solving constrained linear problems that are simple enough that there are a lot of ways to do it but "..." could be a problem.

A good resource for general solvers etc. would be GAMS. Much of the software there may be a bit heavy weight for what you are asking.

Solution 3

I know it is not your real question, but you can simplify the given equation to:

d = b * c * e with e != 0

Solution 4

You want a computer algebra system.

See https://stackoverflow.com/questions/160911/symbolic-math-lib, the answers to which are mostly as relevant to c++ as to c.

Share:
11,523
Fabian
Author by

Fabian

Updated on June 07, 2022

Comments

  • Fabian
    Fabian almost 2 years

    I need to solve a few mathematical equations in my application. Here's a typical example of such an equation:

    a + b * c - d / e = a
    

    Additional rules:

    • b % 10 = 0
    • b >= 0
    • b <= 100
    • Each number must be integer
    • ...

    I would like to get the possible solution sets for a, b, c, d and e.

    Are there any libraries out there, either open source or commercial, which I can use to solve such an equation? If yes, what kind of result do they provide?

  • Lokesh Tulsani
    Lokesh Tulsani over 15 years
    That doesn't work for d=0, b=1, c=1. The best I came up with is b * c = d / e
  • David Nehme
    David Nehme over 15 years
    this looks almost nothing like linear programming.