Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Why this algorithm work only for 4 equations ?

1 回表示 (過去 30 日間)
Joseph El Bacha
Joseph El Bacha 2014 年 10 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
This algorithm solves n non linear equations for n variables. And it is working only for n=4. I cant find why, if anyone can help please ?

回答 (1 件)

Matt Tearle
Matt Tearle 2014 年 10 月 22 日
Your checkResult function is returning something insufficiently close to zero. Given that it seems to be comparing the result from fsolve with some kind of analytic solution, the only conclusion I can make is that your analytic solution doesn't make the function in myObjectiveFunction. You can easily check the solution returned by fsolve by evaluating myObjectiveFunction with it (you can also get the function value back as a second output from fsolve). It's pretty much 0 for n = 3 and n = 5, but n = 6 didn't converge (too many function calls).
So either myObjectiveFunction or the analytic solution in checkResult is not giving the value you expect. Without knowing the math of what you're trying to do, it's impossible to know what the exact problem is. Do you have some known values you can evaluate these for and check that they give the values you expect?
  1 件のコメント
Joseph El Bacha
Joseph El Bacha 2014 年 10 月 22 日
Yes I have the known values for n=4 and the program is giving the correct answers for n=4. The prog I already sent is useful in the triphase inverter.
Please find attached another program for the single-phase inverter very close to the previous one but working for all n !!! And I couldnt know why.
Thank you.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by