How to tell if c++ S-function is being linearized?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Alain Kuchta
le 16 Mai 2017
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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Trimming and Linearization dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!