MATLAB Answers

Can anyone help me code the fsolve equivalent in C/C++?

21 ビュー (過去 30 日間)
Pratik Bajaria
Pratik Bajaria 2015 年 5 月 13 日
コメント済み: Pratik Bajaria 2015 年 5 月 14 日
Off-lately, i have been working on some code which requires conversion of MATLAB's "fsolve" function into C/C++. Although, i am pretty aware that MATLAB's fsolve is speed efficient and requires no more tuning to get to the kernel level language. But, there is some application i am working on which requires the fsolve calculations to be done at kernel level and hence C/C++ or any UNIX/LINUX base shell script would do.
Please let me know if i am unclear or do write in case of any doubts or if some solution already exists and i am unaware. (coz, i already searched a lot on the internet and i wasn't able to.
Regards, Pratik

  2 件のコメント

Walter Roberson
Walter Roberson 2015 年 5 月 13 日
You need to specify which of the Algorithms you are invoking, and whether you are supplying your own Jacobian
Pratik Bajaria
Pratik Bajaria 2015 年 5 月 14 日
@Walter Roberson @Jan Simson
I am working with global solutions. In particular, the solutions that are independent of the initial conditions. So, i did some research and found that Levenberg-marquedt algorithm or Trust region algorithm could help. But, i am unable to find the equivalents on the internet, maybe i am searching it wrong. Could you guide me on what algorithm suites best to finding a global solution which are initial condition independent.
Regards, Pratik


回答 (1 件)

Jan 2015 年 5 月 13 日
Did you read the documentation of fsolve? This is a quite huge function using a lot of different options, methods and strategies. Look at the list of publications on the bottom. Mathworks does not publish the source code of their implementation, but you can find C code for all methods in the net. It would be an overkill to implement the complete fsolve, so start with finding out, which algorithm is required for the problems you are working with.

  0 件のコメント


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by