how to solve differential equation when the derivative is in right and left side of the equation.

조회 수: 8 (최근 30일)
Hi guys,
I have a program that needs to solve a differential equation in it and I know that ode45 can solve it in matlab. But, the problem here is that some of our equations are like these:
dx(1) = -k_psi*x(1)+dx(23)
dx(12) = -dx(1)*x(12) + d1 + (1/m)*(sin(x(16))*cos(x(15))*K_T*f_t),....
because of the initial conditions that are not very simple, I cannot integrate it by hand and when I run the program, it says dx(23) is not defined yet. dx is the output of my function and x is input. I searched on web, though I couldnot find anything. Can anyone help?

채택된 답변

Torsten
Torsten 2019년 7월 2일
편집: Torsten 2019년 7월 2일
MATLAB solves ODE systems of the form
A(t,x)*dx = f(t,x)
So put all dx terms on the left-hand side, determine the matrix A and use the MASS MATRIX option of the ODE integrators.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by