I am currently trying to calculate the velocity distribution over an airfoil for a problem at work and am stuck on how to properly type this into Matlab. I know that x′ is a dummy chordwise coordinate I should use in the integral to distinguish it from x, but am confused how to relay that to Matlab. How do I distinguish x' from x and then sum up all those values to get the full velocity distribution over the chord in Matlab?
My coworker recommends using traps, but I am unsure how to work with x'. T
Vt = zeros(length(XC), 1); % XC corresponds to the x value used to calculate dT/dxfor i = 1:length(XC)
Prime = XC(i); % x'
dT = dT(i); % dT/dx'
X = XC;
X(X==XPrime) = 0; % remove the x = x' singularity to allow proper integration
int_expression = (1/2*pi)*dT*(X-XPrime);
Vt(i) =-trapz(X, int_expression);
end
The integral is in the link and simple, with dT/dx posted as a photo as well. dT/dx that plugs into the equation that is being integrated