How to modify a Simscape element parameter during simulation?

4 ビュー (過去 30 日間)
Brian Stobie
Brian Stobie 2013 年 11 月 12 日
回答済み: Zack Peters 2013 年 11 月 12 日
I have a model of a system that includes Simscape electrical parts. I need to make a capacitance in the model vary as a function of a time varying signal in the model. Normally it is simply entered as a numerical constant during the part definition. How can I do this?

採用された回答

Zack Peters
Zack Peters 2013 年 11 月 12 日
Unfortunately, nearly all of the parameters are not tunable during the course of a simulation. As a workaround to this, you can create a custom component which takes an input from a physical signal, whose signal you can control and tune within the Simulink environment.
As an example you can create a capacitor element whose capacitance parameter is controlled by an input signal to the element rather than a dialog parameter.
All of the source code for the base Simscape components is available from the block's dialog. You should be able to begin from the source code from the Capacitor block and add an input to the block of capacitance rather than a parameter.
Hope this helps,
~Zack

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVariable Initialization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by