May-04-2018, 02:19 PM (This post was last modified: May-04-2018, 03:11 PM by buran. Edited 2 times in total.)

I have this code bellow

[[-r*P[1, 0] - t*P[1, 2] + P[0, 1]]]

[[-r*P[2, 0] - t*P[2, 1] + P[0, 2]]]

[[-r*P[0, 1] - t*P[0, 2] + P[1, 0]]]

[[-r*P[2, 1] - t*P[2, 0] + P[1, 2]]]

[[-r*P[0, 2] - t*P[0, 1] + P[2, 0]]]

[[-r*P[1, 2] - t*P[1, 0] + P[2, 1]]]

How do I solve this system of equations F[j,k]?

Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.

See BBcode help for more info.

from __future__ import division import numpy as np from sympy import * t, r = symbols('t, r') A = np.matrix(input("Insert Matrix nxn: ")) n = A.shape[1] C = MatrixSymbol('P', n, n) D = np.multiply(A,C) SomP = D.sum(axis=1) F = np.multiply(A,C) for j in range(n): for k in range(n): if D[j,k]!=0: F[j,k] = D[j,k] - t*(SomP[k] - D[k,j]) - r*D[k,j] print F[j,k]and, for example, giving the matrix [[0,1,1],[1,0,1],[1,1,0]], I get this equations:

[[-r*P[1, 0] - t*P[1, 2] + P[0, 1]]]

[[-r*P[2, 0] - t*P[2, 1] + P[0, 2]]]

[[-r*P[0, 1] - t*P[0, 2] + P[1, 0]]]

[[-r*P[2, 1] - t*P[2, 0] + P[1, 2]]]

[[-r*P[0, 2] - t*P[0, 1] + P[2, 0]]]

[[-r*P[1, 2] - t*P[1, 0] + P[2, 1]]]

How do I solve this system of equations F[j,k]?

**buran**wrote May-04-2018, 03:11 PM:Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.

See BBcode help for more info.