Saturday, 14 September 2013

How to find x to make sure sum(row[i])-sum(clo[i])=bi in python?

How to find x to make sure sum(row[i])-sum(clo[i])=bi in python?

Suppose I have a matix
x = [[x00,x01,x02,x03],
[x10,x11,x12,x13],
[x20,x21,x22,x23],
[x30,x31,x32,x33]]
x[i][j]>=0
b = [5,-4,5,-6]
I am looking for an easy way to find out each value for x to make sure that
x[i][0]+x[i][1]+x[i][2]+x[i][3]-x[0][i]-x[1][i]-x[2][i]-x[3][i] == b[i]
I have tried many methods, but all failed. Thank you.

No comments:

Post a Comment