Bottom Page

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 I need a help to solve equations system alizo_as Unladen Swallow Posts: 1 Threads: 1 Joined: May 2018 Reputation: 0 Likes received: 0 #1 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 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 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. Gribouillis  Posts: 1,785 Threads: 15 Joined: Jan 2018 Reputation: 169 Likes received: 432 #2 May-04-2018, 04:51 PM (This post was last modified: May-04-2018, 04:51 PM by Gribouillis. Edited 1 time in total.) In what sense are the F[j, k] a system of equations? I only see a set of coefficients depending on r, t and the coefficients of P. What are the unknowns? Can you also describe the mathematical problem that you are trying to solve? « Next Oldest | Next Newest »

Top Page

 Possibly Related Threads... Thread Author Replies Views Last Post Solve a system of non-linear equations in Python (scipy.optimize.fsolve) drudox 7 9,052 Aug-18-2018, 02:27 AM Last Post: scidam Euler class for solve System of ODE drudox 0 715 Jul-08-2018, 09:31 PM Last Post: drudox

Forum Jump:

Users browsing this thread: 1 Guest(s)