How to use fsolve solution as its initial values for the next step size

조회 수: 3 (최근 30일)
Ismaeel
Ismaeel 2018년 5월 4일
댓글: Walter Roberson 2018년 5월 5일
Hi, I want to solve a system of nonlinear equations (having sine and cosine) inside a user-defined function in Simulink. It works well. However, the initial values I gave the solver for t=0 is no longer a good guess for the next step size of running the program. So my question is, how can I give the solver initial values equal to the solution for the previous step? Of course, at t=0, I have already set a vector of constant initial conditions. Note that if I connect the output of the block (solution of fsolve) as an input to the block (to be used as initial values for fsolve inside the block), there will be algebraic loop problem; consequently, the program stops. Any idea?

답변 (1개)

Walter Roberson
Walter Roberson 2018년 5월 5일
  댓글 수: 4
Ismaeel
Ismaeel 2018년 5월 5일
Thanks. Yes, it is a MATLAB Function block. But sorry, I didn't get what you mean exactly by your question.

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

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by