How to add a constraint to $Ax=B$ to avoid the trivial answer zero?

551 Views Asked by At

I have a large system of equations for this cyclic pattern: $$ \begin{matrix} t_0*d_0 & -t_1*e_0 = 0 \\ t_1*d_1 & -t_2*e_1 = 0 \\ t_2*d_2 & -t_3*e_2 = 0 \\ t_3*d_3 & -t_4*e_3 = 0 \\ \vdots & \vdots \\ t_{i-1}*d_{i-1} & -t_i*e_{i-1} = 0 \\ \end{matrix} $$

Where: $ t_i $ are variables. And $ d_{i-1} $ and $ e_{i-1} $ are coefficients that $\neq 0$ in this application.

$i$ will be large and my hope is that this is simple enough to run through a built-in solver for R (xolve(a,b)) or Octave (linsolve(a,b)).

As it is, solving from the $Ax=B$ form $$ \left[ \begin{matrix} d_0 & -e_0 & 0 & 0 & 0 & \cdots \\ 0 & d_1 & -e_1 & 0 & 0 & 0 \\ 0 & 0 & d_2 & -e_2 & 0 & 0 \\ \vdots & & & \ddots & \ddots &0 \\ 0 & 0 & 0 & 0 & d_{i-1} & e_{i-1} \\ \end{matrix} \right] \left[ \begin{matrix} t_0 \\ t_1 \\ t_2 \\ t_3 \\ \vdots \\ t_i \end{matrix} \right] = \left[ \begin{matrix} 0 \\ 0 \\ 0 \\ \vdots \\ 0 \\ \end{matrix} \right] $$ Results in the trivial answer all $t_i=0$. But adding a constraint like $t_1=20$ allows for a non-trivial solution.

My questions is how do I modify something like this so that I can use the built in solvers? For simplicity, let $i=4$ here. $$ \left[ \begin{matrix} d_0 & -e_0 & 0 & 0 & 0 \\ 0 & d_1 & -e_1 & 0 & 0 \\ 0 & 0 & d_2 & -e_2 & 0 \\ 0 & 0 & 0 & d_3 & -e_3 \\ \end{matrix} \right] \left[ \begin{matrix} t_0 \\ 20 \\ t_2 \\ t_3 \\ t_4 \\ \end{matrix} \right] = \left[ \begin{matrix} 0 \\ 0 \\ 0 \\ 0 \\ \end{matrix} \right] $$ Does that just become $$ \left[ \begin{matrix} d_0 & 0 & 0 & 0 & 0 \\ 0 & 0 & -e_1 & 0 & 0 \\ 0 & 0 & d_2 & -e_2 & 0 \\ 0 & 0 & 0 & d_3 & -e_3 \\ \end{matrix} \right] \left[ \begin{matrix} t_0 \\ t_1 \\ t_2 \\ t_3 \\ t_4 \\ \end{matrix} \right] = \left[ \begin{matrix} 20*e_0 \\ -20*d_1 \\ 0 \\ 0 \\ \end{matrix} \right] $$

2

There are 2 best solutions below

0
On BEST ANSWER

Add $t_1=20$ as a 1st row constraint, which makes the number of equations same as variables thus providing unique solution if involved $A$ in $Ax=b$ is invertible. $$\left[ \begin{matrix} 0 & 1& 0&0&0\\ d_0 & -e_0 & 0 & 0 & 0 \\ 0 & d_1 & -e_1 & 0 & 0 \\ 0 & 0 & d_2 & -e_2 & 0 \\ 0 & 0 & 0 & d_3 & -e_3 \\ \end{matrix} \right] \left[ \begin{matrix} t_0 \\ t_1 \\ t_2 \\ t_3 \\ t_4 \\ \end{matrix} \right] = \left[ \begin{matrix} 20 \\ 0 \\ 0 \\ 0 \\ 0\\ \end{matrix} \right]$$

Since the 1st matrix is invertible, the values of t's will be obtaoned by multiplying its inverse on both sides.

$$ \left[ \begin{matrix} t_0 \\ t_1 \\ t_2 \\ t_3 \\ t_4 \\ \end{matrix} \right] = \left[ \begin{matrix} 0 & 1& 0&0&0\\ d_0 & -e_0 & 0 & 0 & 0 \\ 0 & d_1 & -e_1 & 0 & 0 \\ 0 & 0 & d_2 & -e_2 & 0 \\ 0 & 0 & 0 & d_3 & -e_3 \\ \end{matrix} \right]^{-1} \left[ \begin{matrix} 20 \\ 0 \\ 0 \\ 0 \\ 0\\ \end{matrix} \right]$$

1
On

Adding more equations cannot increase the number of solutions to a system of linear equations. A homogeneous system always has the trivial solution. Your system is underdetermined, though, so unless it’s inconsistent it will also have an infinite number of non-trivial solutions. You haven’t taken that into account in your solution of the system. For example, if all of the $d_k$ are nonzero, the general solution is of the form $$t_1 = {e_0e_1\cdots e_{n-1}\over d_0d_1\cdots d_{n-1}}t_n \\ t_2 = {e_1\cdots e_{n-1}\over d_1\cdots d_{n-1}}t_n \\ \vdots \\ t_{n-1} = {e_{n-1}\over d_{n-1}}t_n$$ with $t_n$ free. If any of the $d_k$ are zero, there will be even more free variables.

Adding more equations can either make no difference to the number of solutions (the constraints are redundant), make the system inconsistent, or open up the possibility of there being a unique solution.