View raw

1 function z = get_int(xi,xf,u) 2 3 M = 0.02; 4 P = 0.4; 5 T = 0.12; 6 a0 = 0.2969; 7 a1 = -0.126; 8 a2 = -0.3516; 9 a3 = 0.2843; 10 a4 = -0.1015; 11 12 13 %evaluate the integral of camber line, depending on xi and xf related to P 14 15 if xf <P 16 intCamb = M/P^2*(2*P*xf^2/2 - xf^3/3) - M/P^2*(2*P*xi^2/2 - xi^3/3); 17 elseif xi<P 18 intCamb = (M/(1-P)^2)*((1 - 2*P)*xf +2*P*xf^2/2 - xf^3/3) - (M/(1-P)^2)*((1 - 2*P)*P +2*P*P^2/2 - P^3/3); 19 intCamb = intCamb + M/P^2*(2*P*P^2/2 - P^3/3) - M/P^2*(2*P*xi^2/2 - xi^3/3); 20 else 21 intCamb = (M/(1-P)^2)*((1 - 2*P)*xf +2*P*xf^2/2 - xf^3/3) - (M/(1-P)^2)*((1 - 2*P)*xi +2*P*xi^2/2 - xi^3/3); 22 end 23 24 % do integral on thickness line 25 %z_thickness = (T/0.2)*(a0*x^.5+a1*x+a2*x^2+a3*x^3+a4*x^4); 26 27 intThickness = (T/0.2)*(a0*xf^1.5/1.5 + a1*xf^2/2 + a2*xf^3/3 + a3*xf^4/4 +a4*xf^5/5); 28 intThickness = intThickness - (T/0.2)*(a0*xi^1.5/1.5 + a1*xi^2/2 + a2*xi^3/3 + a3*xi^4/4 +a4*xi^5/5); 29 30 % combine both integral results to get total integral 31 if u == 1 32 z = intCamb + intThickness; 33 else 34 z = abs(intCamb - intThickness); 35 end