Which documentation and example can I use for iterative solution.
1 回表示 (過去 30 日間)
古いコメントを表示
Dear expert,
I was struglling with my matlab model. I have a cascade of functions which each set of function recieves the outputs of the other function as an input arguments. To run all these cascaded functions, the first set of functions needs guess values. The outputs of this functions set should be used as inputs for the next set of functions and continue like this untill the final part. Then the outputs of the last set of functions should be the same with guessed values in the begining using iterative approach. This will be the solution of my model. However, I don't know how to make an iterative solution for this problem which will stop iterating when the guess value is equal to the final calculated value (the difference between them converges to zero).
Can someone help me with examples or which documentation can I use, please? I thank you a lot in advance.
N.B I can share codes but it is too much for help.
12 件のコメント
Torsten
2023 年 1 月 12 日
編集済み: Torsten
2023 年 1 月 12 日
It's not unusual that you get different results from "fsolve" if you use different initial guesses for the solution.
In the list of return parameters, you should check "exitflag" and "fval" to get an idea of whether "fsolve" succeeded or not.
Since "fsolve" wants to make the residuals equal to 0, it's not necessary to square y(1:3) - Cp_guess(1:3) elementwise. Just use
sol = Cp_calc(1:3) - Cp_guess(1:3)
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!