Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

error loop related to code not converging

1 visualizzazione (ultimi 30 giorni)
Chinaemerem Valentine Nwobi
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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

Risposte (0)

Questa domanda è chiusa.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by