Remix.run Logo
0cf8612b2e1e a day ago

Tangentially, are there any symbolic algebra systems that can handle millions of equations?

I have never used a symbolic algebra system, but came across a problem where I am trying to model a deterministic simulation system. I can write out the computation graph (~20 million equations for final state), but Sympy chokes on seemingly dozens of symbols. No hope of processing the final state or being able to express a simulation state in terms of my desired input variables.

Not sure if my expectations are mismatched with reality, I am hugely bungling the tool, or Sympy has laughable performance vs the more capable commercial options.

FilosofumRex a day ago | parent | next [-]

There is no general purpose solver available that can symbolically solve 20M equations, and unfortunately, progress in this field has been excruciatingly slow.

It's highly unlikely it's possible, even in theory. Symbolic solvers must explore many known "routes" to expand and simply given equations, without any theoretical guarantees. Even if you found a symbolic solution to your 20M system, it'd have so many terms in it that you'd have to settle for a numerical approximation, just to make sense of them all.

Numerical solvers are of course, a different matter, altogether.

0cf8612b2e1e a day ago | parent [-]

Ahh nuts. I was foolishly optimistic because my experience with SAT solvers has been magical where they can effortlessly chew through huge numbers of constraints. Was thinking that computers are really fast and good at math, surely they can balance a bunch of algebra given some guidance.

Ah well. Will have to resign myself to raw numbers.

FilosofumRex a day ago | parent [-]

I can't recommend SAT solvers enough, the CS community isn't familiar with them and don't appreciate their vast improvements in recent years. If you've the luxury of formulating your 20M system in terms of satisfiability problem, it'd well worth a try.

Unfortunately, most problems in physics(field equations), or engineering (Navier Stokes) can't be formulated as satisfiability problems.

6gvONxR4sf7o a day ago | parent | prev [-]

Presumably if you have 20 million equations, they came from a program that's has fewer than 20 million moving parts, like if they came from A x = b where the matrix A has 20M entries. The gist is either exploit structure to make a massive number of small equations or keep the symbols in their "natural" form instead of reducing to scalars, and work with more advanced CAS functionality (like, you might have to learn about noncommutative variations on groebner bases). But also, yes sympy is ultra slow with some things.