P = 912;
L0 = 100;
A = [6.90565 6.95464]; B=[1211.033 1344.8]; C=[220.79 219.482];
xtspan = linspace(0.40,0.80,100);
[xt, L] = ode45(@Moles, xtspan, L0);
L = L(end);
fprintf('The amount of liquid remaining in the still when liquid mole fraction of toluene reaches 0.80 is %f moles', L);
function Kt = EquilibriumRatio(Psatt)
Kt = Psatt/P;
end
function Psatt = VaporPressuret(T,A,B,C)
Psatt = 10^(A(2)-B(2)/(T+C(2)));
end
function Psatb = VaporPressureb(T,A,B,C)
Psatb = 10^(A(1)-B(1)/(T+C(1)));
end
function dLdx = Moles(xt,L)
T0 = 95.585;
options = optimset('Display','off','TolX',1e-6);
T = fzero(@temp, T0, options);
Psatt = VaporPressuret(T);
Kt = EquilibriumRatio(Psatt);
dLdx = L/(xt*(Kt-1));
end
function Tempfun = temp(T,xt,P,A,B,C)
Psatt = VaporPressuret(T,A,B,C);
Psatb = VaporPressureb(T,A,B,C);
Tempfun = Psatt*xt + Psatb*(1-xt) - P;
end
>> project2
Error using fzero (line 306)
FZERO cannot continue because user-supplied function_handle ==> temp failed with the error below.
Not enough input arguments.
Error in project2>Moles (line 30)
T = fzero(@temp, T0, options);
Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:});
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in project2 (line 7)
[xt, L] = ode45(@Moles, xtspan, L0);
9 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_109968
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_109968
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_365839
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_365839
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_417414
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_417414
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_436859
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_436859
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_436902
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_436902
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_628643
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_628643
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_628706
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_628706
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_753414
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_753414
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_753555
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/53100-not-enough-input-arguments#comment_753555
サインインしてコメントする。