% mma_plot_sweep - Plot MMA WBDDS RGA moment due to ground loads
%
% David Edwards <david@btdt.org>  8/19/06


% Compute Mrga_wind and total loading about the RGA

K1=15.471;               % Load per unit height of projected area
Fwind1=K1 .* s.Height;
Fwind=1.0 .* Fwind1;

dwind=0.5 .* s.Height;
F2=Fwind .* (dwind ./ s.d2);
Mrga_wind=F2 .* s.d1;

Mrga_total1= -s.Mrga - Mrga_wind;
Mrga_total2= (-2*s.Mrga) - Mrga_wind;


close all

s=read_dat('mma.dat')

Ssize = get(0,'ScreenSize');

% Plot Mrga vs RGA angle
name='RGA Moment Vs. RGA Angle';
figure('Name',name,'Position',[5 Ssize(4)/2-25 Ssize(3)/2-10 Ssize(4)/2-50])
plot(s.Arga,-s.Mrga)
title(name,'FontSize',12)
xlabel('RGA Output Angle [deg]')
ylabel('RGA Moment [in-lbf]')
grid

% Plot Height vs Adoor
name='Projected Height of Door Vs. Door Angle';
figure('Name',name,'Position',[Ssize(3)/2+5 Ssize(4)/2-25 Ssize(3)/2-10 Ssize(4)/2-50])
plot(s.Adoor,s.Height)
title(name,'FontSize',12)
xlabel('Door Angle [deg]')
ylabel('Projected Door Hieght [in]')
grid

% Plot Mrga_wind vs Adoor
name='Moment About RGA Due to Wind Load on Both Doors Vs. Door Angle';
figure('Name',name,'Position',[Ssize(3)/2+5 Ssize(4)/2-25 Ssize(3)/2-10 Ssize(4)/2-50])
plot(s.Adoor,-Mrga_wind)
title(name,'FontSize',12)
xlabel('Door Angle [deg]')
ylabel('Mrga - Both Doors [in]')
grid

% Plot Combined loading - Both Doors
name='RGA Moment (both doors) Vs. RGA Angle';
figure('Name',name,'Position',[5 Ssize(4)/2-25 Ssize(3)/2-10 Ssize(4)/2-50])
plot(s.Arga,-2*s.Mrga,s.Arga,-Mrga_wind,s.Arga,Mrga_total2);
title(name,'FontSize',12)
xlabel('RGA Output Angle [deg]')
ylabel('RGA Moment [in-lbf]')
legend('Door Weight', 'Wind Load', 'Combined Load')
grid

% Plot Combined loading - One Doors
name='RGA Moment (one door) Vs. RGA Angle';
figure('Name',name,'Position',[5 Ssize(4)/2-25 Ssize(3)/2-10 Ssize(4)/2-50])
plot(s.Arga,-s.Mrga,s.Arga,-Mrga_wind,s.Arga,Mrga_total1);
title(name,'FontSize',12)
xlabel('RGA Output Angle [deg]')
ylabel('RGA Moment [in-lbf]')
legend('Door Weight', 'Wind Load', 'Combined Load')
grid

