Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

error loop related to code not converging

1 Ansicht (letzte 30 Tage)
Chinaemerem Valentine Nwobi
Chinaemerem Valentine Nwobi am 30 Apr. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 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

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by