How can I tune a block parameter till I retrieve a desired output?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
arturo pietri
il 11 Set 2020
Commentato: arturo pietri
il 15 Set 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 Commenti
Risposta accettata
sruthi gundeti
il 13 Set 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su General Applications in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!