RK4 method for solving first order equations
2 次查看(过去 30 天)
显示 更早的评论
% % % Equations % % %
syms T1(t) T2(t) T3(t) T4(t) T5(t) T6(t)
delta_T1 = ((2*alpha_1/lamda1^2)*(zeeta_12+eeta_1-2)*T1 + (2*alpha_1/lamda1^2)*zeeta_21*T2 + (2*alpha_1/lamda1^2)*eeta_5*T5 + (2*alpha_1/lamda1^2)*eeta_6*T6) == -((2*alpha_1/lamda1^2)*((Qe/2)/(k1*A1/lamda1)+(k5*A5/lamda5)+(k6*A6/lamda6)));
delta_T2 = ((2*alpha_2/lamda2^2)*zeeta_12*T1 + (2*alpha_2/lamda2^2)*(zeeta_21+zeeta_23-2)*T2 + (2*alpha_2/lamda2^2)*zeeta_32*T3);
delta_T3 = (2*alpha_3/lamda3^2)*(zeeta_23*T2 + (zeeta_32+zeeta_34-2)*T3 + zeeta_43*T4);
delta_T4 = ((2*alpha_4/lamda4^2)*(zeeta_34*T3 + (zeeta_43+eeta_4-2)*T4 + eetap_5*T5 + eetap_6*T6)) + ((2*alpha_4/lamda4^2)*((h_air*Sc*Tc/2)/(k4*A4/lamda4)+(k5*A5/lamda5)+(k6*A6/lamda6)+(h_air*Sc/2)));
delta_T5 = (2*alpha_5/lamda5^2)*(eeta_1*T1 + eetap_4*T4 + (eeta_5+eetap_5-2)*T5 + (eeta_6+eetap_6)*T6) + ((2*alpha_5/lamda5^2)*(h_steam*Sc*Tc/2)/(k4*A4/lamda4)+(k5*A5/lamda5)+(k6*A6/lamda6)+(h_steam*Sc/2)) == -((2*alpha_5/lamda5^2)*(Qe/2)/(k4*A4/lamda4)+(k5*A5/lamda5)+(k6*A6/lamda6));
delta_T6 = (2*alpha_6/lamda6^2)*(eeta_1*T1 + eetap_4*T4 + (eeta_5+eetap_5)*T5 + (eeta_6+eetap_6-2)*T6) + ((2*alpha_6/lamda6^2)*(h_liquid*Sc*Tc/2)/(k4*A4/lamda4)+(k5*A5/lamda5)+(k6*A6/lamda6)+(h_liquid*Sc/2)) == -((2*alpha_6/lamda6^2)*(Qe/2)/(k1*A1/lamda1)+(k5*A5/lamda5)+(k6*A6/lamda6));
delta_T = [delta_T1; delta_T2; delta_T3; delta_T4; delta_T5; delta_T6];
vars = [T1(t) T2(t) T3(t) T4(t) T5(t) T6(t)];
i have these 6 equtions i need to solve them through iteratively through RK4 method im facing difficulty to solve all six of them simultanenously and update them accordingly
1 个评论
John D'Errico
2024-5-31
编辑:John D'Errico
2024-5-31
help ode45
Unless of course, this is homework, and then you need to write it yourself. But if you need to write it yourself, then you should not be asking others to do it for you.
If not homework, then you should use ode45. Never write your own solvers when far better tools are available, written by professionals for your use. So which is it? Homework, in which case you have no choice, or actual work, in which case you should not be doing what you think you need to do?
回答(1 个)
Francisco J. Triveno Vargas
2024-7-17
You need to define the parameters alpha, lambda eta, zeta, etap, after you need to review
because you are using the simbolic toolbox
Regards
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!