I want to analyse the composition of a ternary mixture (a mixture containing of three components) by combining measurements of the mixture's density (denoted $\rho$) and its refractive index (denoted $n_D$).
To do so, I measured both density and refractive index of several samples with known composition. The data I gained should be used to build a model by means of regression. A very basic approach would be as follows:
$$ \rho = a_\rho \cdot w_1 + b_\rho \cdot w_2 + c_\rho \cdot w_3 + d_\rho \\ n_D = a_{n_D} \cdot w_1 + b_{n_D} \cdot w_2 + c_{n_D} \cdot w_3 + d_{n_D} $$
$a_i$ to $d_i$ are regression parameters for the density or the refractive index, respectively. The mixture composition given as mass fractions is described by $w_i$ where $i = 1...3$ (mass fraction for each component in mixture, 3 components in total).
As the mixture fulfills the mass balance, I can extend the system of equations by the following equation: $$ \sum_i w_i = 1 $$
For a ternary mixture, this equation can be rewritten as
$$ 1 = w_1 + w_2 + w_3 $$
As the valid range for mass fractions is $0...1$, I need to meet the following constraint for each mixture component:
$$ 0 \leq w_i \leq 1 $$
I have found a very similar question dealing with a single equation and additional constraints to be fulfilled.
However, how can I perform a regression on my dataset using the set of equations
$$ \rho = a_\rho \cdot w_1 + b_\rho \cdot w_2 + c_\rho \cdot w_3 + d_\rho \\ n_D = a_{n_D} \cdot w_1 + b_{n_D} \cdot w_2 + c_{n_D} \cdot w_3 + d_{n_D} \\ 1 = w_1 + w_2 + w_3 $$
and fulfilling the constraint $0 \leq w_i \leq 1$ for each component $i$?
Any hint would be appreciated as I do not know where to start and definitely need to extend my mathematical knowledge in order to solve this task.