필터 지우기
필터 지우기

How to debug .ssc file for custom simscape component

조회 수: 6 (최근 30일)
Sudhanshu Goel
Sudhanshu Goel 2018년 8월 28일
답변: Javier Gazzarri 2023년 8월 1일
I have a custom created simscape block in my model. At certain point in the simulation I get an error "Transient initialization, solving for consistent states and modes, failed to converge. Nonlinear solver: failed to converge, residual norm too large."
This error occurs inside a loop in the source code (.ssc file) of custom simscape component. I want to know if there is a method by which I can find out the values of parameters used in the loop which ultimately triggers the error.
Something like a break point as in the case of normal .m file or if there is any other way to figure out what happens inside the loop which is causing the error. Thanks in advance.
  댓글 수: 2
Miles Walker
Miles Walker 2020년 12월 11일
Hello Sudhanshu, did you find a solution to this in the end? It seems to me there aren't many tools available for debugging custom Simscape components (assuming they've passed the ssc_build stage).
Hitesh
Hitesh 2023년 7월 6일
Even i would like to take this opportunity to ask for availability of debugger for custom Simscape components. Any support from Mathworks Team on this?

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

답변 (1개)

Javier Gazzarri
Javier Gazzarri 2023년 8월 1일
Hello Sudhanshu, Hitesh,
The equivalent to a breakpoint is not possible in Simscape because the code in an ssc file is not executed sequentially like in a MATLAB script, but rather is compiled at the start of the simulation to define a behavior as part of a physical matrix.
Would you be able to share the code that is causing the problem so that we can take a look at your specific case? Is this a fluids simulation with phase change? This physical domain is typically difficult to initialize and good initial states are needed for the model to initialize correctly.
Best regards,
Javier

카테고리

Help CenterFile Exchange에서 Foundation and Custom Domains에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by