**INPUT DATA**

clear all; clc;-

%% Definition of input pressure-

P = 1e3.\*[75.232 70 60 50 65 75 80 76 60 65 70 75 80 84 89 80 76 70 65 60 55]'; %% Initialization of other required parameters

Rsp = 287; %(J/(kg /(kg K)) specific gas constant for air-

T = 298; %( kelvin) assuming constant temperature throughout altitude Pnot = 101.325e3; %(Pa) sea-level pressure-

g = 9.81 ;%( ms^-2) acceleration due to gravity %z(size(P))=[];-

% %Calculation of height and display of message for i = 1: size (P)-

z(i) = (Rsp\*T/g)\*log(Pnot/P(i));-

if (z(i) >= 2500) disp('NO WARNING') elseif (z(i) >= 1500) disp('TERAINTERRAIN') else disp('PULL UP') end-

end

%%Note

%z = 2500 corresponds to P = 75.232 kPa %z = 1 500corresponds to P = 84.748 kPa %z = 0000 corresponds to P = 101.325 kPa-

## *6.5.2. Program for the simulation of excessive closure rate*

In this simulation of excessive closure rate, we are going to simulate the aircraft moving on its path without collision with the terrain using the terrain awareness and warning system (mode 2) as per the regulation. The mode 2 warns flight crew of excessive closure rates with the rapidly rising terrain. If terrain rises significantly within 2000feet of the aircraft, the terrain closure rate is measured. Up to this stage the "NO WARNING" message is displayed and when the aircraft reaches the maximum closure value at the higher threat condition the "TERRAIN TERRAIN PULL UP" message is displayed. And when the aircraft passes the terrain it came to normal low level fight and then "NO WARNING" message is shown.-
