I want to duplicate an element $d$ in a list (vector?) of $N$ weights such that each (possibly duplicated) weight value $W_{n}$ maintains the same weighted difference between all other weight values. This constraint can be represented as:
$(W_{k}-W_{k+1})(F_{d}W_{d}+(N+1)S) + \sum_{n=0}^{N-1}W_{n}(F_{n}(W_{k}-W_{k+1})-F_{k+1}W_{k+1}+F_{k}W_{k})=0,\forall{0\le{k}\le{N-1}}$
Where the weights are transformed by $W_{n}^{\prime}=F_{n}W_{n}+S$ and I need to solve for $S$ and each $F_{n}$.
This leaves me with 2 degrees of freedom. I also know that $W_{n}\gt{0}$ and I need $W_{n}^{\prime}\gt{0}$, but I don't know how to add that as a constraint to my system. I don't think you can put inequalities in a matrix, so I assume it needs to be representable as a linear multivariate equation. Does there exist such an equation?
I'm hoping for an algebraic relationship with that property to then build my additional equations. Arbitrarily fixing the DOF actually works for most lists, but for some combinations of values, some of the adjusted weights are negative. Although I'm pretty sure it's possible for a generic solution, I'd rather have an unsolvable matrix than an unacceptable solution.
I am a newbie here, but I'll try my best.
The way I see it you can solve for all $F_n$, but you don't have enough equations to solve for $S$ as well. You could consider building a system by taking the source term on the right-hand side and expanding $W_n$ to all the terms in the sum: $$ \sum_{n=0}^{N-1}{F_n(W_k-W_{k+1})W_n - F_{k+1}W_{k+1}W_n + F_kW_kW_n} = (W_{k+1}-W_{k})(F_dW_d + (N+1)S).$$ You could then bring the constant part of the sum to the right-hand side: $$ \sum_{n=0}^{N-1}{F_n(W_k-W_{k+1})W_n} = (W_{k+1}-W_{k})(F_dW_d+(N+1)S)+\sum_{n=0}^{N-1}{F_{k+1}W_{k+1}W_n - F_kW_kW_n} $$
Now the right-hand side is composed by all terms you know, you could stack each equation for all $k$ into a matrix $A$ and each term of the right-hand side into a column vector $\mathbf{b}$.
Now the constraints:
So you want $W_n' > 0$, which means $F_nW_n + S > 0$. You could introduce slack variables $v_n, \ (n = 0, 1, ..., N-1)$ such that $F_nW_n+S-v_n=0$. This -in practical terms- means you'll be stacking these $N$ equations as additional rows and adding $N$ columns to your system matrix $A$, each column corresponds to one slack variable and will have a $1$ in the row for which it is "relaxing" the constraint. This way you end up with a $2N\times 2N$ square matrix which is quite sparse and solvable with Linear Solvers that are specialized for sparse matrices. The solution will be a vector $\mathbf{z} \in \mathbb{R}^{2N}$ which should have exactly half of its entries to $0$ and the other half containing your $F_n$ (I figure you'd need to have your solver also keep track of which variables are in base and which are not).
I hope this helps. Again, I'm a newbie so this might be completely wrong.