If vpasolve cannot find a solution

2 ビュー (過去 30 日間)
esra ilhan
esra ilhan 2020 年 12 月 5 日
コメント済み: Walter Roberson 2020 年 12 月 6 日
Dears,
I am trying to solve equations with vpasolve, the first solver gives the solution, while the second one fails to give a solution, is there any suggestion for the given system?
% ONE REACROR WITH A VOLUME OF 500 dm^3
V_CSTR1 = 500;
syms X T
sol1 = vpasolve([T0 + X*(-DH)/(DeltaCp)== T,0==FA0*X/(CA0^2*(1-X)^2*(k0*exp(E_R *(1/T0 -1/T)))) - V_CSTR1], [X,T],[0.9,500]);
S1 = [sol1.X sol1.T];
% TWO REACTORS WITH A VOLUME OF 250 dm^3
V_CSTR2 = 250; %dm^3
syms X1 T1 X2 T2
sol2 = vpasolve([T0 + X1*(-DH)/(DeltaCp)== T1,0==FA0*X1/(CA0^2*(1-X1)^2*(k0*exp(E_R*(1/T0 -1/T1)))) - V_CSTR2, T1 + (X2-X1)*(-DH)/(DeltaCp)== T2,0==FA0*(X2-X1)/(CA0^2*(1-X2)^2*(k0*exp(E_R *(1/T0 -1/T2)))) - V_CSTR2], [X1,T1,X2,T2],[0.7,500,0.9,550]);
S2 = [sol2.X1 sol2.T1 sol2.X2 sol2.T2];
Thank you for the answer

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 12 月 5 日
sol2 = vpasolve([T0 + X1*(-DH)/(DeltaCp)== T1,0==FA0*X1/(CA0^2*(1-X1)^2*(k0*exp(E_R*(1/T0 -1/T1)))) - V_CSTR2, T1 + (X2-X1)*(-DH)/(DeltaCp)== T2,0==FA0*(X2-X1)/(CA0^2*(1-X2)^2*(k0*exp(E_R *(1/T0 -1/T2)))) - V_CSTR2], [X1,T1,X2,T2], [0 1; -inf inf; -inf inf; -inf inf]);
[0.88240997524634695443929681283911, 476.48199504926939088785936256782, 1.0355693874983732380716901511454, 507.11387749967464761433803022908]
which is not terribly bad compared to your initial conditions.
  2 件のコメント
esra ilhan
esra ilhan 2020 年 12 月 6 日
Thank you for the answer, the code now indeed works and calculates for the second solver however, X1 and X2 values shoul not exceed the value of 1 and now I have 1.035 (correct answer for that is 0,967 says the book), do you have any further comments for that?
Walter Roberson
Walter Roberson 2020 年 12 月 6 日
sol2 = vpasolve([T0 + X1*(-DH)/(DeltaCp)== T1,0==FA0*X1/(CA0^2*(1-X1)^2*(k0*exp(E_R*(1/T0 -1/T1)))) - V_CSTR2, T1 + (X2-X1)*(-DH)/(DeltaCp)== T2,0==FA0*(X2-X1)/(CA0^2*(1-X2)^2*(k0*exp(E_R *(1/T0 -1/T2)))) - V_CSTR2], [X1,T1,X2,T2], [0 1; -inf inf; 0 1; -inf inf]);
0.96937039317956112668398133819721 for X2.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by