1 | initial version |
In this simple case (one libear dependance), it is easy to find the expressions of the rational functions to a common denominator and to explore their span.
Running :
reset()
Vars=var("x, y")
C1=1/x
C2=1/(x+y)
C3=y/(x*(x+y))
Sys=[C1, C2, C3]
# Find the LCM of denominators
L=lcm(map(denominator, Sys))
# Numerators of the rational expressions expressed with denominator L
Nums=[u.numerator()*L/u.denominator() for u in Sys]
# Expression of the linear dependance :
Dep=pari.lindep(Nums).sage()
print("Dependance = ", Dep)
# Check
print("Check : ", bool(vector(Dep).dot_product(vector(Nums))==0))
gives :
sage: load('/tmp/sage_shell_modeZ6Ph52/sage_shell_mode_temp.sage')
Dependance = [1, -1, -1]
Check : True
Of course, you have to manage the necessary condition of the non-nullity of the common denominator yourself...
HTH,