import sympy as sp
from fractions import Fraction
new_matrix_aux = [['X', 'B', 'X1', 'X2', 'X3', 'X4', 'X5', 'U1', 'U2'],
['X2', 10/3, 0, 1, 2/3, 1/3, -2/3, -1/3, 2/3],
['X1', 4/3, 1, 0, 2/3, -2/3, 1/3, 2/3, -1/3]]
z_function = "Z = 1 * X1 + 2 * X2 + 3 * X3 + 0 * X4 + 0 * X5 + M * U1 + M * U2"
lista_de_operaciones_zj = []
for j in range(1, len(new_matrix_aux[0])):
z = z_function
for …Run Code Online (Sandbox Code Playgroud)