Find maximum on steady state condition from a vector (hard)
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I'm doing vibration analysist with labview and runink my simulink model on matlab. I'm using the variable "x_optimisee" as an array vector that contains few hundred thousand values from a 0 times to something like 15000. I need the amplitude of my graphic after a certain time. Usually I use function max(abs()) but this time I can't use it because it will thake the maximum of the transiant part witch is higher than the steady stade maximum. I know that I'm approx. in steady state condition after the 15 000th value. But this isn't necessarily a maximum. So I would like to have the maximum from 15 000 up to lenght(x_optimisee) ideally.
My program is included into a for loop because I have to try my equation at different frequency. So here is what I've done yet but it isn't working, just to show you the main idea.
Thank to the master that will be able to solve this!
warning on
j=1;
clc
for omega=100:1:160;
%sim Labo2
sim Lab2simulinkoptimise % Simulink
Xqueue_j=max(abs(x_optimisee));
omega_g_j(j)=omega;
Tq_j(j)=Xqueue_j*keqa/(m*e*omega^2);
j=j+1;
end
for i=1:200000
x_optimisee(i)=0;
end
figure(100) plot(omega_g_j,Tq_j)
The x_optimisee(i)=0 was a try to use a maximum on the same vector but with 0 on all values of the transiant condition. But this isn't possible because the amplitude Xqueue_j is needed into the loop. What would be a great way to solve this? Thank you!
0 commentaires
Réponse acceptée
dpb
le 19 Mar 2017
How about showing us a plot of a typical time trace?
My first inclination would be to do some heuristic searches to find the "steady-state" location in time, then process off that.
But, as for the query as stated, it's simple enough to find a maximum over a portion of the vector as "maximum from 15 000 up to length(x_optimisee)"
idx1=15000; % say, the "magic number" of SS condition arrival
[maxX,imax]=max(x_optimisee(idx1:end)); % max in that portion to end
To locate where this is in the original vector, just add the initial offset to the found location (less 1 to account for base 1 indexing)
imax=idx+imax-1;
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!