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!