Trapezoidal integration for pressure
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi guys, I have a set of streamlines made up from coordinates in the z-x axis like in the picture shown. Each blue line represents a separate streamline made up of coordinates in z and x. Along each of these streamlines I know the exact coordinates and also the pressure at each corresponding z-x and coordinate. Hence for each streamline I have a seperate matrix made up of the columns z, x and pressure. I need to now integrate the pressure distribution across the surface using the 'composite trapezoid rule' however i'm having no luck in this. An example of one of the streamline matrices is like so, in which i've tried to use the trapz function but the surface pressure is very wrong.
x = [0.025 0.0233 0.0243 0.02477 0.0254]
z = [0.3658 0.3722 0.3991 0.433 0.477]
P = [24460 24690 25005 25101 25512]
Streamline1 = [x(:) z(:) P(:)]
trapz(Streamline1)
this is just a small segment of one of the streamlines, and i have 31 of them. Is there a way i can integrate each streamline to find the pressure distribution across every streamline, so i can then calculate the pressure across the entire surface? The fact that the streamlines are changing in both the z and x axis make the integration even more confusing for me. Any help would greatly be appreciated, thanks!
0 commentaires
Réponses (1)
Alan Stevens
le 7 Août 2021
Do you mean something like this?
x = [0.025 0.0233 0.0243 0.02477 0.0254];
z = [0.3658 0.3722 0.3991 0.433 0.477];
P = [24460 24690 25005 25101 25512];
% Streamline coordinates
s = sqrt(x.^2 + z.^2);
% figure(1)
% plot(s,P,'o-'),grid
% xlabel('s'),ylabel('P')
pressure = @(S) interp1(s,P,S);
dS = (max(s)-min(s))/100;
S = min(s):dS:max(s);
p = pressure(S);
% figure(2)
% plot(S,p),grid
I = trapz(p)*dS;
disp(I)
Voir également
Catégories
En savoir plus sur Spline Postprocessing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!