# Solving system of linear and non-linear equations?

My system of equations have both linear and non-linear equations but not quadratic or cubic or equations having variable degree more than one. example :

  x + y = 3 (linear),
y + z = 4 (linear),
x * z = 6 (non-linear),
x / y = 3 (non-linear),
y * z / x = 2 (non-linear)


There can be hundreds of equation in these system. There is no quadratic or cubic equation.

I want to know which algorithm is best for solving these system of equations and which language is better C or Matlab .

-
I would use the linear equations to simplify the problem, and then deal with the nonlinear equations. For example, here you can replace $y$ with $3-x$ and $z$ with $1-x$, so the third equation becomes $x(1-x)=6$ (solvable). Then you can back-substitute and see if it solves the rest of your equations. – Arturo Magidin Aug 26 '11 at 20:59
Matlab has a function fsolve for numerically solving systems of nonlinear equations. C does not. Reinventing the wheel might be a nice exercise, but for practical purposes it's usually best to use existing tools. – Robert Israel Aug 26 '11 at 21:01
Some of these are essentially linear: for example $x/y=3$ is the same as $x-3y = 0$ (and $y\not = 0$) – Henry Aug 26 '11 at 22:16
yz/x = 2 is of degree 2 (it is the same as x = 2yz, which has a term of degree 1 in y + degree 1 in z = total degree 2). What does it mean that there is "no quadratic or cubic equation"? Using multiple equations like x=a, y=a, z=xy one can encode quadratic and higher-degree equations such as z = a+1 instead of a^2 = a + 1. – zyx Aug 26 '11 at 23:13
Worst comes to worst, it might be a good idea to use Gröbner bases for this... – J. M. Aug 28 '11 at 18:18

In the worst case this is equivalent to solving (using real or complex numbers, to some given accuracy) an arbitrary system of nonlinear polynomial equations in many variables. Extra variables and equations of type $a = bc$ to can be used to encode $n^{\rm th}$ powers and sums of multiple terms.