Python Forum
Write the Matrix2 by using Matrix1
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write the Matrix2 by using Matrix1
#2
Let me get this straight. You got two matrices using the same sympy variables and you want to fill the tables now and assigning every variable a 1x64 matrix. so if matrix_a[0][0] == matrix_b[0][0] then matrix_a[0][0] = [1,0,.....,0] and matrix_b[0][0] = [1,0,......,0] and if not matrix_a[0][0] == matrix_b[0][0] then matrix_a[0][0] = [1,0,.....,0] and matrix_b[0][0] = [0, 1,0,......,0] since matrix_a would recieve the value of rho00 and matrix_b the value of (for example) rho10, right?
if that is the case the Matrix objects (well for example and those are what you want to use) can be handy as they have the subs method where you can assign a variable a value. so you can do that for both matrices with the same values for the same variables. Since it can also accept dictionaries you will have quite the easy job and do not have to iterate through everything :)
take a short look here:
https://stackoverflow.com/questions/3293...n-in-sympy
Reply


Messages In This Thread
Write the Matrix2 by using Matrix1 - by quest - Jan-19-2022, 12:20 PM
RE: Write the Matrix2 by using Matrix1 - by ThiefOfTime - Jan-19-2022, 01:47 PM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-19-2022, 11:43 PM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-20-2022, 08:20 AM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-20-2022, 11:37 AM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-20-2022, 11:54 AM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-20-2022, 12:29 PM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-20-2022, 11:18 PM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-20-2022, 11:58 PM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-22-2022, 12:41 AM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-23-2022, 11:57 PM
RE: Write the Matrix2 by using Matrix1 - by quest - Jan-24-2022, 01:07 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020