I have two sets of $n$ 3 dimensional vectors independent from eachother ;
$$A = (f_1, f_2, ..., f_n)$$ $$C = (m_1, m_2, ..., m_n)$$
I am looking for the set of $n$ real factors, $X = (X_1, X_2, ..., X_n)$, that will make the following true:
$$ \left\{ \begin{array}{c} X_1 f_1 + X_2 f_2 + ... + X_n f_n = b \\ X_1 m_1 + X_2 m_2 + ... + X_n m_n = d \\ (X_1, X_2, ..., X_n) \geq 0 \end{array} \right. $$
i.e.: $$ \left\{ \begin{array}{c} AX = b \\ CX = d \\ X \geq 0 \end{array} \right. $$
I know how to obtain the optimized solution $X\geq 0$ for the individual cases of $AX = b$ or $CX = d$ using the pseudo-inverse of $A$ or $C$, $A^+$ or $C^+$ (case for $AX = b ; X \geq 0$):
$$ X = A^+b + [I-A^+A]w1 \tag{1}$$ $$ X = C^+d + [I-C^+C]w2 \tag{2}$$
Coupled with a quadratic programming solver given:
\begin{array}{ll} \underset{w}{\text{minimize}} & \frac{1}{2}w^TPw+q^Tw\\ \text{subject to} & Gw \leq h\end{array}
with (the addition of $\varepsilon*I$ in $P$ is to ensure it is definite positive):
$$P = [I - A^+A]^T[I-A^+A]+\varepsilon *I$$ $$q = -([A^+b]^T[I-A^+A])$$ $$G = -[I - A^+A]$$ $$h = [A^+b]^T$$
However, I can't figure out how to obtain both $w1$ and $w2$ so that the initial system remains true. Depending on $A$ and $C$, a solution might not exist, I am only considering cases where at least one solution exists.
Equations $(1)$ and $(2)$ allow to obtain all solutions for respectively $AX = b$ and $CX = d$, by variation of $w1$ and $w2$. In a way, I am looking for the solutions (if there are any) $X\geq 0$ that lie in the union of the solutions given by $w1$ and $w2$, if that makes any sense.
It gives me (I think?) a linear optimization problem, but with matrices and vectors instead of scalars:
$$ \left\{ \begin{array}{c} F(w1, w2) = J + Kw1 - L - Mw2 \\ Kw1 \geq -J \\ Mw2 \geq -L \\ \end{array} \right. $$
with:
$$J = A^+b$$ $$K = [I-A^+A]$$ $$L = C^+d$$ $$M = [I-C^+C]$$
Any solution so that $F(w1, w2)$ equals $0$ would mean that a proper solution exist, I suppose. How can I obtain the optimized solution for that program?