Back calculating Ki from test data
Afficher commentaires plus anciens
Hello,
I have a simple PI loop that I am tying to back calculate Ki using test data. From the loop, Ki is given by the below equation:
[Current Trim Value - Previous Trim Value] / Error*Kp*Ts. I have test data for the Error and Trim in the form or an m x 1 array. Any idea ow I can do this? The main challenge I am having is how to calculate [Current Trim Value - Previous Trim Value] from the data. I tried using the following for loop to do it, but I get an error saying "Array inddices must be positive integers or logical values"
for j = 1: length(TrimArray)
Ki(j) = [TrimArray(j) - TrimArray(j-1)] / Error(j)*Kp*Ts
end
I see why I get that error I'm getting because at J = 1, you can have index number = 0. Note that TrimArray and Error are test data recorded at 50Hz.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!