How to solve a system of 3 ODE and a linear equation.
조회 수: 1 (최근 30일)
이전 댓글 표시
How to solve a system of 3 ODE
dvdt=z;
dzdt=-v/(L0*C0)-z*R0/L0
dTempdt=R0*((C0*z)^2)/(m_ponte*Cp_Al)
and one linear equation: R=R0*(1+Alfa*(temp(i)-T0)) to consider the resistence variation with temperature instead of constant resistence R0?
F=@(t, v, z, temp) [z; -v/(L0*C0)-z*R0/L0; R0*((C0*z)^2)/(m_ponte*Cp)];
v(1)=-20000;
z(1)=0;
temp(1)=298;
t(1)=0;
for i=1:N
k1 = h*F(t(i), v(i), z(i), temp(i));
k2 = h*F(t(i)+h/2, v(i)+k1(1)/2, z(i)+k1(2)/2, temp(i)+k1(3)/2);
k3 = h*F(t(i)+h/2, v(i)+k2(1)/2, z(i)+k2(2)/2, temp(i)+k2(3)/2);
k4 = h*F(t(i)+h, v(i)+k3(1), z(i)+k3(2), temp(i)+k3(3));
v(i+1) = v(i) + (1/6)*(k1(1)+2*k2(1)+2*k3(1)+k4(1));
z(i+1) = z(i) + (1/6)*(k1(2)+2*k2(2)+2*k3(2)+k4(2));
temp(i+1) = temp(i) + (1/6)*(k1(3)+2*k2(3)+2*k3(3)+k4(3));
end
댓글 수: 0
채택된 답변
Shadaab Siddiqie
2021년 2월 23일
From my understanding you want to solve an 3rd degree ODE equations. You can go through solve ODE, symbolic variables and expressions and also dsolve for more information.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!