ODE45 solving rate too low
이전 댓글 표시
I am trying to model a reactor and solving a series of differential equations using ODE45.
The rate of reaction is very low when solved on MATLAB but when I take the equation conditions and put it into excel I am getting a much higher rate, which is the same answer as my hand calculated values.
I think there is an error with the equation itself and how I've written it, but I've looked at it all day and can't seem to locate where it is wrong. Below is the equation from literature and the code snippet shows my implementation.

T = var(1);
P = var(2);
FA = var(3);
FB = var(4);
FC = var(5);
FD = var(6);
F_tot = FA + FB + FC + FD + F_E0 + F_F0 + F_G0; %mol/hr
molA = FA/F_tot;
molB = FB/F_tot;
molC = FC/F_tot;
molD = FD/F_tot;
K = exp((4577.8/T)-4.33);
P_atm = P*0.00986923; %atm
FPress = P_atm^(0.5-(P_atm/250));
r_A = -FPress * (1.69*10^9) * exp(-88000/(R * T)) * (molA^0.9) * (molB ^0.31) * (molC^-0.156) * (molD ^ -0.05) * (1-((molC * molD)/(molA * molB * K)));
The differential equations look like this:
diffeqs = [
(H_rxn*r_A)/(F_A0 * (CO_eng + H20_eng + CO2_eng + H2_eng + Ar_eng +N2_eng + CH4_eng))
- ((alpha/2*p)*(T/T_0))
r_A
(H20/CO)*r_A
-(H2/CO)*r_A
-(CO2/CO)*r_A
답변 (1개)
Torsten
2022년 4월 1일
0 개 추천
I can't see something wrong in the equation itself, but of course I don't know if the inputs have the correct units etc.
But for reaction engineering simulations, you should use ode15s instead of ode45 for better performance.
댓글 수: 1
BeigeSponge
2022년 4월 1일
편집: BeigeSponge
2022년 4월 1일
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

