How to tell if c++ S-function is being linearized?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I have a non-linear c++ s-function in which I need to perform additional calculations to update various parameters that are not persistent during linear analysis runs to obtain an accurate result. This s-function is being linearized by MATLAB's numerical perturbation methods. In the time domain I do not need to perform these calculations again. Is there a flag or parameter somewhere that can be read by an s-function which shows if the current model is being linearized?
Currently I've hobbled together the s-function reading a variable I'm setting in my workspace for linear analysis runs, but this isn't an ideal solution to maintain portability across different applications.
I am running on r2014b.
Thanks, Seth
EDIT: For now I've decided to look through MATLAB's dbstack and look for the 'linearize' function somewhere in that stack. This does not seem ideal but works for the time being.
댓글 수: 3
Alain Kuchta
2017년 5월 16일
Hi Seth,
Thanks for providing a detailed description. I think using a block parameter to indicate when the block should behave in normal mode vs. linearization mode is the best solution available. I'm not aware of any way to detect that a block is being executed as part of linearization of a model.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Aerospace Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!