Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
1.67/5 (2 votes)
See more:
I have an equation system with multi-variable, as:
f1(x1, x2, x3,..., xn)=0
f2(x1, x2, x3,..., xn)=0
.....
fn(x1, x2, x3,..., xn)=0
There, f1, f2,..., fn are functions with x1, x2,..., xn which are parameters (variables of the equation system).

I want to solve this system by C#, what algorithm to solve it? Thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 25-Nov-13 10:53am    
It cannot be solved with any arbitrary functions. The functions should behave in certain regular way, be "smooth enough", represent a certain class of functions. Otherwise, not only solution is impossible, in some cases, even the meaning of solution cannot be mathematically formulated (there are so-called "ill-posed problems"). There is no one single algorithm.
—SA
Andrewpeter 25-Nov-13 10:59am    
Thanks SA, I will think more about this. I know it's very difficult.
Sergey Alexandrovich Kryukov 25-Nov-13 11:04am    
Too bad presently I don't know a good library I would be familiar with. I would start with the links I recommended in my answer myself.
However, you eventually can go deeper: if you find a good library targeting native platform, you can P/Invoke it...

By the way, for some classes of functions (for example, linear), the solution is pretty easy, but for general case, it's simply impossible, even theoretically. Could you specify what's inside your functions?

—SA
johannesnestler 25-Nov-13 10:57am    
If you find it - let me know...

Please see my comment to the question: it my turn into a really difficult problem. There is no one common algorithm; the algorithm would depend on the class of functions, applicable only to certain classed of functions, and, in general case, even the notion of the solution cannot be mathematically defined.

You can start, say, here: http://en.wikipedia.org/wiki/List_of_numerical_libraries#.NET_Framework_languages_C.23.2C_F.23_and_VB.NET[^].

—SA
 
Share this answer
 
Comments
Ron Beyer 25-Nov-13 11:23am    
+5, added a good book in my answer.
Sergey Alexandrovich Kryukov 25-Nov-13 11:31am    
Thank you, Ron.
—SA
Andrewpeter 26-Nov-13 10:10am    
Thanks SA, it's great. My vote is 5 for you.
Sergey Alexandrovich Kryukov 26-Nov-13 11:20am    
You are welcome.
Will you also accept the answer formally then (green "Accept" button)?
—SA
Andrewpeter 27-Nov-13 8:42am    
OK SA.
In addition to Sergey, you may find that reading the book titled "Numerical Recipes in C" ISBN 0-521-43108-5 may help you with methods to find the values of the coefficients. Search for the book on Google, I won't post the link because a lot of the links are bootleg versions.

You will find though that this is a very difficult area of programming, if you aren't concerned about how long it takes to solve your equations then you shouldn't have too many problems but I recently worked on a minimization solver that was constrained for time (had to solve in 100ms or less) for equations that are much more complicated than you have. We ended up going a different direction because an MP-LP solver took too long on our target equipment.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Nov-13 11:30am    
Sure, a 5.
—SA
Andrewpeter 26-Nov-13 10:12am    
Thanks. My vote is 5. I found out that book, it's really great.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900