How to tell if c++ S-function is being linearized?
1 次查看(过去 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!