I am trying to solve an electrical pi-network that looks like this:
un uf
o-->-----[zb]------<---o
+ | | +
pn [yn] [yf] pf
- | | -
o----------------------o
I do the nodal analysis and get an equivalent system of equations that look like this for two unique sets of p's and u's.
un1, un2, uf1, uf2, pn1, pn2, pf1, pf2, yn, yf, zp = symbols('un1 un2 uf1 uf2 pn1 pn2 pf1 pf2 yn yf zp')
eqns=[un1 -pn1*(yn + 1/zp) - pf1*(-1/zp),
uf1 - pn1*(-1/zp) + pf1*(yf+1/zp),
un2 - pn2*(yn + 1/zp) - pf2*(-1/zp),
uf2 - pn2*(-1/zp) - pf2*(yf + 1/zp)]
I want to solve for yn, zp and yf in terms of the u and p terms since the u and p terms are given. (By u and p I mean un1, un2, uf1, uf2, pn1, pn2, pf1, pf2).
I found the response at the bottom and tried to use the linsolve function, but I get the null set:
In: linsolve(eqns, [yn, yf, zp])
Out: EmytySet()
If I put in dummy coefficients for the equations, than it behaves as expected
In: Y11, Y12, Y21, Y22 = symbols('Y11, Y12, Y21, Y22')
In: eqns_test = [un1 -pn1*Y11 - pf1*Y12,
uf1 - pn1*Y21 - pf1*Y22,
un2 - pn2*Y11 - pf2*Y12,
uf2 - pn2*Y21 - pf2*Y22]
In: linsolve(eqns_test, Y11, Y12, Y21, Y22)
Out:{((pf1*un2 - pf2*un1)/(pf1*pn2 - pf2*pn1), (-pn1*un2 + pn2*un1)/(pf1*pn2 - pf2*pn1), (pf1*uf2 - pf2*uf1)/(pf1*pn2 - pf2*pn1), (-pn1*uf2 + pn2*uf1)/(pf1*pn2 - pf2*pn1))}
How should I solve this system of equations?
https://stackoverflow.com/questions/31547657/how-can-i-solve-system-of-linear-equations-in-sympy#=