Here’s a simple example of how i begin to attempt to solve a system of 2 equations in sympy. My goal is to first set equal to each other my equations:
import sympy as sp
x,y,z = sp.symbols("X, Y, X")
print(sp.Poly((x-y),sp.Derivative).coeffs())
print(sp.Poly(sp.Eq(x,y),sp.Derivative).coeffs())
However,I need to set equal to each other not just with two equations. Here’s what I tried that doesn’t work:
import sympy as sp
x,y,z = sp.symbols("X, Y, X")
print(sp.Poly(sp.Eq(x,y,z),sp.Derivative).coeffs())
TypeError: new() takes from 2 to 3 positional arguments but 4 were given
For the more algebraic way similar to x-y, i don't know how to implement with 3 or more equations.
How do I extend my example to three or more equations? Is this possible with sympy? If not, are there alternative libraries that do something similar? Any help would be appreciated.
EDIT: So when i had 2 polynomial(or factorial equations) equations that is very similar in structure other than their given beta constants, their first degree differential theoretically should equate to each other. This emulates the maclaurin series where my 2 factorial equations try to converge to a general unknown function.I would use sp.idiff() to implicitly differentiate both equations. sp.idiff() will implicit solve for dx0, where i still need to solve for dx1. I solve for dx1 as follows:
equation1 = sp.idiff(expr1,array-like,respective_beta)
equation2 = sp.idiff(expr2,array-like,respective_beta)
coeffs = sp.Poly((equation1-equation2),sp.Derivative).coeffs()
dx1 = coeffs[-1]/coeffs[0]
After getting dx1, i can back solve dx0 and finally substitute all the symbols which i get through my design of experiment to emulate something called a multivariate delta theorem.
The problem now is, i do not only have expr1, expr2, i also have expr3. In the future, i would also have expr4,expr5,expr6. I would need to extract the symbolic coefficients from that set of equations that equate to each other to back solve for dx5,dx4,dx3,dx2,dx1 simultaneously.
sp.Poly(sp.Eq(expr1,expr2,expr3,expr4,expr5,expr6),sp.Derivative).coeffs
The above way would obviously throw an error:
TypeError: new() takes from 2 to 3 positional arguments but "N" were given
So the question again is, would there be a mathematical solution or a method from sympy to "make equal" sets of expressions with out solving them. Does sympy support this?