How to obtain an array of values during simulation to use in the same simulation?

6 visualizzazioni (ultimi 30 giorni)
Hi,
I'm doing a simulation of a motor(PMSM) and i want to aproximate de value of one of the parameters of the motor, de friction coeficient. And for that I need to do a linear iinterpolation between the velocity and the torque gnerated. An from that interpolation i want to extract both of the coeficients, especially the slope. For that Im trying to use a function and grab the values measured from the motor and make an interpolation with polyfit(Speed, Torque ,1) . The problem is that the values that the GoTo block reads are not stored in some type of array or vector. so what enters to the function is a single value and the interpolatino can not be done. I know that i can extract data from structures and do the interpolation in the workspace but for this project the calculation need to be done in simulink.
Any idea on how to do that?
Find attached the model that i'm using.
Thanks for your help in advance!

Risposte (1)

Joel Van Sickel
Joel Van Sickel il 9 Nov 2022
One way to store an array of previous values is to use the tapped delay block: https://www.mathworks.com/help/simulink/slref/tappeddelay.html
Regards,
Joel

Categorie

Scopri di più su Simulink in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by