I have a system of equations in the following form $$ \sum_j a_{ij} x_j = c_i + d_i y_j, \quad i, j = 1,\dots,n $$ where $y_i$ are related with $x_i$ as $$ y_i = \begin{cases} -1, &x_i > 0\\ 1, &x_i < 0\\ \in [-1, 1], &x_i = 0. \end{cases} $$ Here $a_{ij}, c_{i}, d_{i}$ are known and $n$ is small (typically, 4 or 6). $a_{ij}$ and $d_i$ are positive and $a_{ij}$ is a diagonally-dominant matrix.
I'm looking for a method to solve such problems. I'm not even certain if it always has a solution (but from a physical point of view, it should). I thought about approximating $y_i(x_i)$ as $y_i = -\tanh(C x_i)$ and solving a sequence of problems with $C \to \infty$, but it seems to be an overkill. Also a brute-force approach is possible, it just requires solving $3^n$ linear systems with all possible combinations of $y_i = -1, y_i = 1, x_i = 0$.
I have a feeling that this problem might be reduced to some linear (or quadratic) programming one.
Also I've noticed that $y_i$ depends on $x_i$ just like Coulomb friction force depends on velocity of moving surfaces. Maybe there are methods for problems with friction that are applicable to my system, but none that I'm aware of.
If you impose some finite bounds, say $|x_i|\le M$, you can solve the problem via mixed integer linear programming as follows. Let $\epsilon > 0$ be some small constant tolerance, and introduce binary decision variables $z_{i,1}$, $z_{i,2}$, $z_{i,3}$ and linear constraints \begin{align} \sum_{k=1}^3 z_{i,k} &= 1 &&\text{for all $i$} \tag1\\ \epsilon z_{i,1} - M x_i z_{i,2}+0z_{i,3} \le x_i &\le M z_{i,1} - \epsilon z_{i,2} + 0z_{i,3} &&\text{for all $i$} \tag2 \\ -1z_{i,1}+1z_{i,2}-1z_{i,3} \le y_i &\le -1z_{i,1} + 1z_{i,2} + 1z_{i,3} &&\text{for all $i$} \tag3 \\ \end{align} Constraint $(1)$ forces exactly one of the three disjoint cases. Constraint $(2)$ enforces $$ (z_{i,1}=1 \implies x_i \ge \epsilon) \land (z_{i,2}=1 \implies x_i \le -\epsilon) \land (z_{i,3}=1 \implies x_i = 0) .$$ Constraint $(3)$ enforces $$ (z_{i,1}=1 \implies y_i = -1) \land (z_{i,2}=1 \implies y_i = 1) \land (z_{i,3}=1 \implies -1 \le y_i \le 1) .$$