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 CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by