%***********************************************************************************
% 
% Lift Force Subfunction
% Primary authors: Kacie Burton, Kevin Dahya, Mellisa Glaser, Kerem Koray
% Wael Nour, and Tanya Tunistra
% AAE 421 Design Project Spring 2001
%
%***********************************************************************************

function [Cl_alpha_w,Cl_alpha_dot,Clq,Cl_alpha_h,de_da_M,Cl_alpha_wb]=liftforce(Cl_alphah,eta_h,Vh,dE_da,xw,cbar,Cl_alpha_w,A,lambda,d_fuselage,b,beta,Cl_alpha,A_horz,h_H,b_horz,l_H,taper,xbar_acw,croot,CL)

% These equations were given in Roskam, Methods for Estimating Stability and Control Derivative os Conventional Subsonic Airplanes

%CR=0;


Clq_w_M0=(0.5+(2*xw)/cbar)*Cl_alpha_w;								%at M=0  Eqn 5.3  Roskam Handout
global B
B=1;																			%defined in main file
Clq_w_M=((A+2*cos(lambda))/(A*B+2*cos(lambda)))*Clq_w_M0;	%at M  Eqn 5.2  Roskam Handout
Clq_h_M=2*Cl_alphah*eta_h*Vh;											%at M  Eqn 5.4  Roskam Handout
Clq=Clq_w_M+Clq_h_M														%Eqn 5.1  Roskam Handout

K_wb=1-.25*(d_fuselage/b)^2+.025*(d_fuselage/b);				%Eqn 3.7  Roskam Handout
global Cl_alpha_w
Cl_alpha_w=(2*pi*A)/(2+sqrt((A^2*beta^2*2*pi/Cl_alpha)*((1+(tan(lambda))^2)/beta^2)+4));	%Eqn 3.8  Roskam Handout
global Cl_alpha_wb
Cl_alpha_wb=K_wb+Cl_alpha_w;											%Eqn 3.6  Roskam Handout
global Cl_alpha_h
Cl_alpha_h=(2*pi*A_horz)/(2+sqrt((A_horz^2*beta^2*2*pi/Cl_alpha)*((1+(tan(lambda))^2)/beta^2)+4));	%Eqn 3.8  Roskam Handout modified for horizontal tail

K_h=(1-(h_H/b_horz))/((2*l_H/b_horz)^3/2);						%Eqn 3.15 or Fig. 3.6  Roskam Handout
K_lambda=(10-3*taper)/7;												%Eqn 3.14 or Fig. 3.5  Roskam Handout
K_A=(1/A)-(1/(1+A^1.7));												%Eqn 3.13 or Fig. 3.4  Roskam Handout
global de_da_M
de_da_M=4.44*((K_A*K_lambda*K_h*sqrt(lambda))^1.19);			%deta/dalpha at M=0   Eqn 3.12  Roskam Handout

Cl_alpha_dot_w=1.5*(xbar_acw*cbar/croot)*Cl_alpha_w+3*CL;	%Eqn 6.2  Roskam Handout														%Eqn 6.2  Roskam Handout, use only for triangular wings
Cl_alpha_dot_h=2*Cl_alphah*eta_h*Vh*dE_da; 						%Eqn 6.3  Roskam Handout
Cl_alpha_dot=Cl_alpha_dot_w+Cl_alpha_dot_h						%Eqn 6.1  Roskam Handout

