Estimating coefficients in a physical system based on observations I have a physical system which can be modelled as
$$Ax+By+C=0$$
I have thousands of measurements of $x$ and $y$ from the physical system (includes some noise).
I want to optimize for $A$, $B$, and $C$.
More Details:
$A$, $B$, and $C$ are composed of other variables which are constrained, and are the real "goal".
$$A = v_1^2 + v_1$$
$$B = v_1^2$$
$$C = v_1^2 (v_2+v_3) + v_1 v_2 + v_2 +v_3$$
$$-\pi/4 \leq v_1 \leq \pi/4$$
$$-100 \leq v_2, v_3 \leq 100$$
I would like to do this in Java (1st choice) or c++ (2nd choice).  I've found many (non)linear optimization and regression package, but the vocabulary is going over my head as to find the proper way (and therefore library+codepath) to approach solving this.
 A: Assuming $B \neq 0$, you can rewrite this as 
$$y = A'x+C'$$
Now, you can use a least square linear regression to find the "best" value of $A'= \frac{A}{B}$ and $C'= \frac{C}{B}$
A: The problem is not so simple if both $X$ and $Y$ are subject to errors. If this is the case, I should minimize $$\Phi(v_1,v_2,v_3)=\sum_{i=1}^n \Big(A(v_1,v_2,v_3)x_i+B(v_1,v_2,v_3)y_i+C(v_1,v_2,v_3)\Big)^2$$ In order to remove  the bound constraints, I should rewrite $$v_i=v_i^{min}+\frac{v_i^{max}-v_i^{min}}{1+e^{-\phi_i}}$$ and use the $\phi_i$ as tuning parameters (which are now unbounded). For sure, the problem is to guess reasonable starting values but a preliminary standard linear regression $$y=\alpha x+\beta$$ immediately gives an estimate of $v_1$ since $$\alpha=-1-\frac 1 {v_1}$$ $$v_1=-\frac{1}{\alpha +1}$$ On the other hand, since $$\beta=-\frac {(v_1^2+1)(v_2+v_3)+v_1v_2}{v_1^2}$$ may be you could assume $v_2=v_3$ and extract $$v_2=v_3=-\frac{v_1^2  }{2 v_1^2+v_1+2}\beta$$ then the $\phi_i$'s from definition and, with all of that, start a minimization process using the corresponding $\phi_i$'s as variables.
Otherwise, perform the minimization with bound constraints.
