How can I tune a block parameter till I retrieve a desired output?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
arturo pietri
le 11 Sep 2020
Commenté : arturo pietri
le 15 Sep 2020
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 commentaires
Réponse acceptée
sruthi gundeti
le 13 Sep 2020
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur General Applications dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!