I have a network and I would like to calculate the voltage drop across the nodes (2-5). I know V1=10 and V6=0. The equations at each node are written as follows. There are 4 equations and 4 unknowns.
2: V1/R12 - V2*(1/R12 + 1/R24) + V4/R24 = 0
3: V1/R13 - V3*(1/R13 + 1/R34 + 1/R35) + V4/R34 + V5/R35 = 0
4: V2/R24 + V3/R34 - V4*(1/R24 + 1/R34 + 1/R46) + V6/R46 = 0
5: V3/R35 - V5*(1/R35 + 1/R56) + V6/R56 = 0
Is there a way to implement it in Python? Manually generating the matrices is tedious for a very large network, say with 100 nodes.
Here's the code in Visual Basic to reduce an $m \times n$ matrix $(a)$ to RREF (reduce row echelon form).