フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

error loop related to code not converging

1 回表示 (過去 30 日間)
Chinaemerem Valentine Nwobi
Chinaemerem Valentine Nwobi 2019 年 4 月 30 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
function[Ps,T,Vl,Vv]= Ps_VDW_Plot(Pc,Tc,Pso,Tmin,dT)
%this is a function that calculates and plot the vapour pressure and the
%specific molar volume V for a pure fluid at given temperature T using both
%VDW-CEOS and considering a minimum value of temperature Tmin(loaded by user this requires
% where DT is stepwise increase in Temperature
%Ps_VDW as a subprogram to run. all parameters in SI units i.e
%P(Pa),T(K),V(m3/mol)
%initializing the iteration process
i=1;
%initial input temperature
T(i)=Tmin;
%calculation of Ps using Ps_VDW function
[Ps(i),Vl(i),Vv(i)]= Ps_VDW(Pc, Tc, Pso, T(i));
while Vl~=Vv
i=i+1;
T(i)=T(i-1)+dT;
[Ps(i),Vl(i),Vv(i)]= Ps_VDW(Pc, Tc, Ps(i-1), T(i));
end
%plot of P vs. T
plot(T,Ps);
end
please am having difficulty getting a fixed result/plot from this function
given that
Pc=4.8e6;
Tc=508.1;
Tmin=300;
dt=0.5;
Pso=100;
please run the file with the details below and tell me why it doesnt give consistent results

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by