Take the 2-minute tour ×

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 .

share|improve this question

closed as not constructive by templatetypedef, cdhowie, Oli Charlesworth, jeffamaphone, Bart Aug 24 '11 at 20:36


This question is almost certainly going to be closed for being too subjective. I think a more interesting algorithms question might be "how would I go about solving this system of nonlinear equations?," leaving the language of choice as a detail to be decided later after you've already figured out how you're planning on solving it. –  templatetypedef Aug 24 '11 at 20:29
When asking which language is better for something, you need to specify what you want to optimize for. Do you want to optimize for speed, precision, or easy of writing the program? –  jeffamaphone Aug 24 '11 at 20:29
I voted for "not a real question" for being "overly broad". –  jeffamaphone Aug 24 '11 at 20:30
add comment

2 Answers

up vote 0 down vote accepted

I would choose to use MatLab seeing that it is designed to solve problems like these. Here is a tutorial on solving a system of linear equations and here is an example of non-linear equations.

I would also suggest to maybe ask this question on the Math site as they might have more experience.

share|improve this answer
add comment

If you use C, you have to either go out and find good numerical methods libraries to help you or write them yourself.

MATLAB is a toolkit of numerical methods libraries. They implemented them so you don't have to. Consider MATLAB to be a higher abstraction of solvers on top.

If you have a single non-linear equation coupled with a bunch of other linear ones, it means you need a non-linear solver. I'd recommend a Newton-Raphson iterative solver, but your best bet is to look into the MATLAB toolbox and see what it offers for non-linear solvers. The one that makes it easiest to represent your set of equations is the best.

share|improve this answer
add comment
