ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 27 Sep 2021 18:01:32 +0200Difference between solve's `r` and `c` solution parametershttps://ask.sagemath.org/question/59176/difference-between-solves-r-and-c-solution-parameters/ Hello, everybody! The author of [this related question](https://ask.sagemath.org/question/59063/weird-c-values-from-solving-system-of-equations/) pointed out an interesting fact: if a system of equations has parameters in its solutions, sometimes the parameters are written as `rN` and sometimes as `cN`, where `N` is a positive integer.
As far as I can tell, the `r`s are produced by Maxima's `solve()` function, while the `c`s are produced by Maxima's `to_poly_solve()` function. Indeed, consider the following system (obtained from a comment in the mentioned question):
a_1, a_2, b_1, b_2 = var('a_1, a_2, b_1, b_2')
eq1 = a_2^2 - a_2*a_1^2 == 0
eq2 = a_2*b_2 - 2*a_1*a_2*b_1 + a_2*b_2 - a_1^2*b_1 == 0
eqs = [eq1, eq2]
If we solve with
from sage.calculus.calculus import maxima
m = maxima(eqs)
sols = m.solve([a_1,a_2,b_1,b_2])
sols._sage_()
then, we get
[[a_1 == 0, a_2 == 0, b_1 == r31, b_2 == r32],
[a_1 == r33, a_2 == 0, b_1 == 0, b_2 == r34],
[a_1 == r35, a_2 == r35^2, b_1 == r36, b_2 == 1/2*(2*r35 + 1)*r36]]
The `r` parameters seem to indicate real parameters, as indicated by [this answer](https://ask.sagemath.org/question/8707/symbolic-solve/) by @kcrisman (sorry to ping you). However, it can clearly be seen that complex parameters are also acceptable. Moreover, the code
from sage.calculus.calculus import maxima
m = maxima(eqs)
sols = m.to_poly_solve([a_1,a_2,b_1,b_2])
sols._sage_()
then, we get
[[a_1 == 0, a_2 == 0, b_1 == c1973, b_2 == c1974],
[a_1 == c1975, a_2 == 0, b_1 == 0, b_2 == c1976],
[a_1 == c1977, a_2 == c1977^2, b_1 == c1978, b_2 == 1/2*(2*c1977 + 1)*c1978]]
There are two possibilities here:
1. `to_poly_solve` is more sophisticated, so it works with complex parameters.
2. The parameters don't indicate real or complex.
Could somebody clarify the difference between `r` and `c` parameters?
Thank in advance for your answers!dsejasMon, 27 Sep 2021 18:01:32 +0200https://ask.sagemath.org/question/59176/