Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function A = coef(alpha)
- % Do not change the function name, number of input and output variables.
- % In this function you have to calculate the coef. A0 to A20 using integrations.
- % The input is only the angle of attack in radian, and the output is a vector array
- % with 21 elements. The first element is A0, and the last element is A20.
- % Note that this function and dcamber do not need the chord length.
- A = zeros(21,1);
- i = 0;
- angle = acos(1-2*0.2025);
- A(1) = alpha - (1/pi)*(integral(@(theta) dcamber(theta).*cos(i*theta),0,angle) + integral(@(theta) dcamber(theta).*cos(i*theta),angle,pi));
- for i = 1:20
- A(i+1) = (2/pi) * (integral(@(theta) dcamber(theta).*cos(i*theta),0,angle) + integral(@(theta) dcamber(theta).*cos(i*theta),angle,pi));
- end
- % Write a loop that goes over the calculation of each element of A using the dz/dx
- % defined in dcamber function.
- % Remember that some functions are defined using the auxiliary variable theta, and
- % some are based on x/c and z/c.
- % Use any integration method you like. But, you may need to increase the accuracy
- % to be able to generate the same coef. as the reference code.
- end
- function dzdx = dcamber(theta)
- % write a function that calculates dz/dx for each value of theta. You may want to
- % create a function that works with a vector array as theta and generates a vector
- % array dzdx corresponding to each element of input.
- xc = 0.5*(1-cos(theta));
- if xc <= 0.2025
- dzdx = 2.6595*(3*(xc).^2 - 1.2150*xc + 0.1147);
- else
- dzdx = -0.02208;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement