I have six equations and six variables. I am solving it through numpy
using np.linalg.solve(a, b)
. The result gives me 6 values but I don't know which value is x1,x2... unknown variable result satisfies only one equation that is
x1+x2+x3+x4+x5+x6=1.
but it does not satisfies other equation. I am considering that x[0] is x1. x[1] is x2 but which is not true because other equation not satisfies when I put according to this format. How can I find which is x1,x2,x3,x4,x5,x6 in returning list? My code is
import numpy as np
a = np.array([[-1,0,0,0.25,1,0.33], [0.33,-1,0,0,0,0.33], [0.33,0.25,-1,0.25,0,0] , [0,0.25,0.5,-1,0,0], [0,0.25,0.5,0.25,-1,0.33], [1,1,1,1,1,1]])
b = np.array([0,0,0,0,0,1])
x = np.linalg.solve(a, b)
print x
answer is:
[ 0.2644666 0.13780854 0.14895903 0.10893165 0.18669913 0.15313504]