% Program to calculate 767 Horizontal Errors % what-if tolerance values, one sigma each D1=.004/3; % hole and slot positions near inboard end D2=.02/3; % shotpeen-induced error D3=.012/3; % slot position error on skins far from inboard end D4=.01; % uniformly distributed plus chord fab error % calculate nominal positions skins; lmax=0; mmax=0; nmax=0; k=10000; % monte carlo loop to calculate propagated variations for i=1:k l(i)=0; m(i)=0; n(i)=0; d(i)=0; end for i=1:k skinerrs; l(i)=63.03-T2G3P(2,4); m(i)=T2S1P(1,4)-3; n(i)=T1G2(1,4)-T1G1P(1,4); % various checks d(i)=DY; if n(i)>nmax nmax=n(i); J=i; end if l(i)>lmax lmax=l(i); K=i; end if m(i)>mmax mmax=m(i); end end % summary histograms hist(n,200) hist(l,200) gapmax=lmax slotmax=mmax PCmax=nmax plot_PC_gap