shouldn't there be two parallel lines on my plot?

조회 수: 1 (최근 30일)
omar mahallawy
omar mahallawy 2019년 1월 15일
댓글: omar mahallawy 2019년 1월 15일
clear,clc,clf
format long
Q=3.3;
%gamma=8.43 kN/m3 = 859.62076503 Kg/m3 (*1000/9.81)
rouh=859.62076503;
g=9.81;
Gamma=(rouh.*g);
Zs=0;
Ze=0;
L=1285000;
Ks=(0.000045);
Er=(1.*10.^-8);
viscosity=(3.83.*10.^-3);
% material grade X70
strength= 482000000;
%API 5L
Do=[1.016 1.06682 1.1176 1.1684 1.2192]
V=((4.*Q)./(pi.*Do.^2))
Re=(V.*Do./viscosity)
Fo=0.01;
for I=0:1:10^6;
Fn=(1./(-4.*log10((Ks./(3.71.*Do))+((1.26)./(Re.*sqrt(Fo)))))).^2;
E=abs((Fn-Fo)/Fn);
if E<=Er;
Fn=Fn(end),display(E),break,
end
if E>Er;
Fo=Fn;
end
end
Hloss=((Fn.*L.*Q.^2)./(12.*Do.^5))
Hpump=Hloss+Ze-Zs
%calculating Hloss every 100000M
HLC=1:128500:1285000;
for i=1:1:length(HLC);
HlossN=((Fn.*HLC(i).*Q.^2)./(12.*Do.^5))
TEL(i,:)=(Hpump-HlossN+Zs)
HGL(i,:)=(TEL(i,:)-((V.^2)./(2.*g)))
Pe=Gamma.*(HGL-Ze);
T=((Pe(i).*Do)./(2.*strength))
end
for ii=1:1:length(Do)
subplot(3,3,ii),
plot(HLC,TEL(:,ii),HLC,HGL(:,ii))
xlabel('HLC')
ylabel('HGL & TEL')
end

채택된 답변

Rik
Rik 2019년 1월 15일
There actually are two parallel lines, but you need to zoom in quite a lot.
If you have a look at the output of the line below, you'll notice that there is not even a percent difference between the two.
TEL(:,ii)./HGL(:,ii)
  댓글 수: 1
omar mahallawy
omar mahallawy 2019년 1월 15일
i feel so stupid right now!
gosh, thank you soo much
life saver!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by