1

I need to solve a large system of equations. The system that I need to solve now has 30 equations and 30 unknowns, but I need to be able to use this same system to solve 1,000 equations and 1,000 unknowns. I do not need to know the answers for all of the unknown variables, I just need to know the answers for a few of them (2 in the 30 equations case, and ~10 in the 1,000 equations case). The equations that I need to solve are each in the form:

(c0 * x0) + (c1 * x1) + ... + (c_n * x_n)

Where x_i is an unknown variable, c_i is a known constant, and n is the number of unknowns that I have.

Solving this system seems like it should be trivial by coding it into a matrix form. However, this is not possible because the majority of my c_i constants have known variables that need to stay in their symbolic form. So, I require a symbolic equation solver.

I have tried to code the system into sympy, which is a symbolic equation solver in python. This is not fast enough for me.

I have tried to think of replacing my c_i values with prime numbers, and factoring out the prime numbers when I reach a solution. However, this will not work either: Many of the constants within the c_i expression are in polynomial form. The polynomials do not go higher than a power of 6.

Is there a solution for me?

  1. Is there a symbolic equation solver that will solve my system quickly?
  2. Is there another way to represent my system of equations so that I can solve it quickly?

My programming background is in python, C++, and R. I am willing to learn new languages/systems in order to solve this problem.

Paul Terwilliger
  • 1,596
  • 1
  • 20
  • 45
  • 1
    It sounds like your computation is slow because the thing it's trying to compute is a symbolic expression of exponentially huge length. – user2357112 Jul 26 '16 at 21:06
  • Yes, and I do not know if there exists a symbolic equation solver that will give me an answer within a reasonable amount of time. If I can even find one for the 30 equations and 30 unknowns case I will be very happy. – Paul Terwilliger Jul 26 '16 at 21:11
  • No software could ever possibly give you an exponentially huge amount of output in a reasonable time. Even if you had a magic answer machine that spits out answers immediately with zero time needed for computation, it would still take ages for the machine to spit out the entire answer. – user2357112 Jul 26 '16 at 21:13
  • Even if the answer is unwieldy and large, if the computer could spit out the answer within a month I would be happy. – Paul Terwilliger Jul 26 '16 at 21:24
  • 1
    I have currently a similar problem. For your case of 30 times 30 probably **sage** (sagemath to search) is enough (I tried it with 220 inequalities and 15 variables -> a few minutes calculating). It is even based on python (you can also do your calculations on cocalc.com). I am extremely unhappy with my case of 1000 inequalities and 45 variables, have you found a another way (I am happy with the existence or non-existence of a solution)? – ctst Feb 01 '18 at 15:02

0 Answers0