# Solving a set of 3 nonlinear equations with constraints

Problem statement:

I am given 3 sets of equations that govern the force $P$, and also the neutral axis, defined by two variables, the radius from the center $r$ and also the rotation degree in $\theta$.

The three simultaneous nonlinear equations I have to solve are listed below:

$$f_1(P,r,\theta)=P-p_c(r,\theta)$$ $$f_2(P,r,\theta)=e_yP-m_{cx}(r,\theta)$$ $$f_3(P,r,\theta)=e_xP-m_{cy}(r,\theta)$$

In order to obtain $P$,$r$ and $\theta$, I would have to solve for $f_1=0$, $f_2=0$ and $f_3=0$.

$e_y$ and $e_x$ are constants.

The constraints that govern the neutral axis variable are

$$-\infty<r<\infty$$ $$0\leq\theta\leq\pi$$

The $p_c$, $m_{cx}$ and $m_{cy}$ are at least differentiable, in the sense that we assume $\frac{\partial p_c(r,\theta)}{\partial r}$, $\frac{\partial p_c(r,\theta)}{\partial \theta}$ and all the terms inside the Jacobian matrix exist, but can only be evaluated through numerical means. As for the terms in hessian matrix, although it is in principle obtainable via numerical means, but I afraid that the error would be too big to be useful.

Question

how to solve for these system of equations?

Attempts

I am thinking about using quasi-newton method to solve this problem, but I don't know how to incorporate the constraints into the quasi-newton method formulation.

Another way is to formulate this into an optimization problem, i.e, minimize for the following $f$ function

$$f=f_1^2(P,r, \theta)+f_2^2(P,r, \theta)+f_3^2(P,r, \theta)$$

and the following constraints:

$$0\leq\theta\leq\pi$$

Is this a convex optimization problem?

But I don't know what are the techniques I can use in this highly nonlinear optimization problem.

• If I'm reading correctly, you're asking us how to solve an equation where technically we still don't really even know what the equations explicitly are: there's no mention as to what $p_c, m_{cx},m_{cy}$ are defined by. You might as well ask us how to generally attack the problem $f(x)=0$ without knowing $f$. Is my understanding accurate?
– anon
Sep 18, 2011 at 8:11
• @anon, yes. We don't know what these equations explicitly are. All we know is that these terms and their first derivatives are evaluatable by numerical means. Sep 18, 2011 at 8:16

There is a c++ port in eigen's non-linear optimization module. The same algorithms are used by Matlab's fsolve and scipy.optimization.fsolve.