How can I tune a block parameter till I retrieve a desired output?
1 回表示 (過去 30 日間)
古いコメントを表示
I would like to be able to run a simulation which tunes the gain value 'A' (The amplitude of my sine wave) so that for a given maximum amplitude of {\theta}, the simulation runs till it finds an appopriate gain 'A' value.
For example: If I would like my {\theta} amplitude to be no more than 2, then for all other values which my {\theta} maximum amplitude does not reach or surpass 2, tune 'A' for values which my {\theta} would achieve a maximum amplitude of 2.
I have tried:
a) Work with If / Else. But this does not allow subsystems with multiple actions.
b) Try using the Logic function 'Compare'. But did not find a proper way to tune 'A'
c) I tried adding a PID, rather than using 'A' as a gain, I would use P as my 'A' value. But did not try further with the I nor D controller for tuning the signal.
d) I tried reworking the whole system. Rather than start integrating from \ddot{\theta}, I started to differentiate from {\theta} (as then I would define my {\theta} as an input rather than a fixed ouput). Never tried this one before, therefore my system would give strange results.
0 件のコメント
採用された回答
sruthi gundeti
2020 年 9 月 13 日
Define Gain 'A' Value From Workspace and Output Variable as To workspace variable and use Data Inspector to record each simulation output
By using m- script
In a for loop
1. change the value Gain A
2. Run the simulation
3.When the Output variable satisfies the criteria ,Break the loop
4.Going over large number of simulations can collapse matlab so limit the iterations of Gain A values and check the results manually to decide the appopriate gain 'A' value.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!