How to create the Gas deviation-factor chart for natural gases from Standing and Katz

조회 수: 2 (최근 30일)
Hi, I have a 1x15 sized Ppr vector, a 1x10 Tpr vector and a 15x10 matrix with the values of the compressibility factor Z corresponding to each Pr and Tr. How can I plot such values in the same plot to get a plot like this one :
From <https://link.springer.com/article/10.1007/s13202-015-0209-3 New explicit correlation for the compressibility factor of natural gas: linearized z-factor isotherms>
Can this be done with a for loop ? I intend to use the script to generate a basic user interface for a school project, and the user should be able to change the dimensions of those vectors and by consequence the size of the matrix is dynamic.

채택된 답변

Are Mjaavatten
Are Mjaavatten 2018년 3월 29일
plot(Ppr,Z);
xlabel('Ppr');
ylabel('Z');
legends = cell(10,1);
for i = 1:10;
legends{i} = sprintf('Tpr = %3.2f',Tpr(i));
end
legend(legends,'location','eastoutside')
% Or maybe better:
% legend(legends,'location','southeast')

추가 답변 (2개)

erik.alcala99
erik.alcala99 2018년 3월 29일
So many thanks Are Mjaavatten, the solution you provided works perfectly. Now I have to get those values correct...

lili lili
lili lili 2018년 11월 25일
Hello, I am having a problem in my plot, I am not getting those curves in the graphs, I am just getting lines. Can you please suggest me any idea to fix it? Thank you.
  댓글 수: 7
lili lili
lili lili 2018년 11월 25일
I finally found it, I used spline and plot. thank you so much for your time sir, I really appreciate that ^^
erik.alcala99
erik.alcala99 2018년 11월 25일
편집: erik.alcala99 2018년 11월 25일
Thats great, no problem, we are here to help, hapy plotting :)

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

카테고리

Help CenterFile Exchange에서 Oil, Gas & Petrochemical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by