필터 지우기
필터 지우기

Which documentation and example can I use for iterative solution.

조회 수: 2 (최근 30일)
Tadele
Tadele 2023년 1월 12일
편집: Tadele 2023년 1월 12일
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
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)
Tadele
Tadele 2023년 1월 12일
편집: Tadele 2023년 1월 12일
That is a very good point. I will check the return parameters. I will also use just y(1:3) - Cp_guess(1:3) without squaring.
Thank you very much, Torsten. It helps me a lot.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by