Ask Your Question

crypto's profile - activity

2024-02-11 20:01:08 +0200 received badge  Notable Question (source)
2020-07-01 12:38:40 +0200 received badge  Popular Question (source)
2018-11-21 20:23:14 +0200 received badge  Student (source)
2018-07-04 22:33:31 +0200 asked a question Substitution of multiple variables, for linearization

Hi

we want to substitute multiple variables, for example x1x3 would be z1, x2x4 would be z2 and so on.

We save all combinations of monomials in a dictionary, then we wanted to use subs to replace the variables, but it does not work. How could one implement this?

The purpose is for linearization of a large system of equations. A system like this: x[1] + x[1]x[2]x[3] + x[1]x[4]x[6] + x[1] + x[4] + x[5] + x[7], x[0]x[1]x[4] + x[0]x[1] + x[2]x[4] + x[3]x[5]x[6] + x[3]x[5] + x[7] + 1, x[1]x[2] + x[2]x[3]x[6] + x[2]x[4] + 1, x[0]x[5]x[6]x[7] + x[1]x[7] + x[2] + x[7], x[1]x[3]x[7] + x[4] + x[5]x[6] + x[6], x[1]x[3] + x[2]x[4] + x[3]*x[4]