Symbolics + Gröbner basis

OK – I have tried the code (I updated all packages first). The second time I run it (as it is), it took 28.5 seconds on my laptop in battery mode (some sort of power efficiency).

  • Is that a decent speed?
  • I see your point about no constant term in the fourth order polynomial for n_H2O_L, i.e., n_H2O_L = 0 being a root. Physically, this would imply that water is completely in the vapor phase. Probably not impossible, but not something I would expect. So would (at the outset) neglect that root. That leaves a third order polynomial, so either 3 real roots or one real and two complex roots. In the latter case, it would be trivial to choose the physical solution. Of course, if the real roots are (i) one negative, (ii) one larger than n_H2O, and a third one, it would also be easy to pick the correct root.

OK – I’ll do some more testing. E.g.,

  1. Check the speed when replacing paramgb with groebner just to check the gain in speed, and
  • Answer: I stopped the computation after some 18 minutes. Will re-run tonight.
  1. Reduce the problem to water + one additional light gas.
  • Answer: With one light gas in addition to water, the solution was found in 0.6 seconds with paramgb. Result: a third order polynomial, again with n_H2O_L equal to zero as one possible root.

I tried to add n_1_g. The result is that gb[1] depends on *both
n_H2O_L and n_1_g, which is not a solution. But, it probably shows some correlation.

Is that a decent speed?

For paramgb, I do not have a reference point: I do not know of any other similar implementations (please tell me if you do!).

In general, for GB over rational function fields we can compare with slimgb in Oscar.jl / Singular.

  1. Check the speed when replacing paramgb with groebner just to check the gain in speed, and
  • Answer: I stopped the computation after some 18 minutes. Will re-run tonight.

I see, thanks for checking. It is hard to tell which one would be faster in advance.

I tried to add n_1_g . The result is that gb[1] depends on *both
n_H2O_L and n_1_g , which is not a solution. But, it probably shows some correlation.

Right, not as useful for solving. It can perhaps be useful for finding interesting conservation laws. As a silly example, with interesting_vars = [n_H2O_L, n_1_g, n_2_g], gb[2] is a relatively small expression that only depends on n_1_g, n_2_g, which may (or may not) tell something useful about the proportional amounts.

1 Like

It would be nice if symbolic_solve was able to solve these equations out of the box.

2 Likes

I’m sure Oscar is nice. However, it is slightly more complicated to install on Windows, I seem to recall: it requires the Windows subsystem for Linux (?), which I have not installed.