Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. function A = coef(alpha)
  2. % Do not change the function name, number of input and output variables.
  3. % In this function you have to calculate the coef. A0 to A20 using integrations.
  4. % The input is only the angle of attack in radian, and the output is a vector array
  5. % with 21 elements. The first element is A0, and the last element is A20.
  6. % Note that this function and dcamber do not need the chord length.
  7. A = zeros(21,1);
  8. i = 0;
  9. angle = acos(1-2*0.2025);
  10. A(1) = alpha - (1/pi)*(integral(@(theta) dcamber(theta).*cos(i*theta),0,angle) + integral(@(theta) dcamber(theta).*cos(i*theta),angle,pi));
  11. for i = 1:20
  12. A(i+1) = (2/pi) * (integral(@(theta) dcamber(theta).*cos(i*theta),0,angle) + integral(@(theta) dcamber(theta).*cos(i*theta),angle,pi));
  13. end
  14. % Write a loop that goes over the calculation of each element of A using the dz/dx
  15. % defined in dcamber function.
  16. % Remember that some functions are defined using the auxiliary variable theta, and
  17. % some are based on x/c and z/c.
  18. % Use any integration method you like. But, you may need to increase the accuracy
  19. % to be able to generate the same coef. as the reference code.
  20. end
  21.  
  22. function dzdx = dcamber(theta)
  23. % write a function that calculates dz/dx for each value of theta. You may want to
  24. % create a function that works with a vector array as theta and generates a vector
  25. % array dzdx corresponding to each element of input.
  26. xc = 0.5*(1-cos(theta));
  27. if xc <= 0.2025
  28. dzdx = 2.6595*(3*(xc).^2 - 1.2150*xc + 0.1147);
  29. else
  30. dzdx = -0.02208;
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement