RK4 method for solving first order equations
3 views (last 30 days)
Show older comments
% % % 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 Comment
John D'Errico
on 31 May 2024
Edited: John D'Errico
on 31 May 2024
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?
Answers (1)
Francisco J. Triveno Vargas
on 17 Jul 2024
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 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!