close all
clear all



[rho S Cp C ] = Constants();
C4 = C/4;


aoa = 0:.5:90;

[cl cd cm]=Coef0015(aoa*pi/180);


V = .25:.25:1.5;


figure

for k = 1:length(V) 
 qinf = .5*rho*V(k).^2;
 M0 = S*qinf*C^2;
 F0 = S*qinf*C;
 
 L = cl*F0;
 D = cd*F0;
 M = cm*M0;

 M_wing = M+L*(Cp-C4).*cos(aoa*pi/180)+D*(Cp-C4).*sin(aoa*pi/180);

 leg_str{k} = ['|V| = ' num2str(V(k)) ' m/s'];
   
 subplot(2,1,1)
 plot(aoa,M_wing*39.4/4.45);
  hold on
 subplot(2,1,2)
 plot(aoa,12*M_wing*39.4/4.45);
 hold on
 
end

subplot(2,1,1)
xlabel('Angle of Attack (deg)');
ylabel('in-lbs');
legend(leg_str);
title('Water Moment on Single Wing')
grid on

subplot(2,1,2)
xlabel('Angle of Attack (deg)');
ylabel('in-lbs');
legend(leg_str);
title('Water Moment on 12 Wings')
grid on