필터 지우기
필터 지우기

Numerically solve a 3rd order differential equation with 3 unknowns

조회 수: 1 (최근 30일)
Raffaele
Raffaele 2023년 6월 1일
댓글: Torsten 2023년 6월 3일
Hi, I have a 3rd order differential equation in y, with 3 unknowns a, b, c. To simplify imagine the equation is:
diff(y, t, 3) + a.*diff(y, t, 2) + b.*diff(y, t) + y.^(3/2) + c.*y == 0;
I know the discrete values of y and the time vector. I want to know tha values of a, b, c that solve this equation. Clearly there will be more combination of this values, but is there a way to solve it? (like with ode function or others).
One idea would be to express all the derivatives as function of y (like using finite differences) and then solve, is there a way to do it automatically on matlab?
  댓글 수: 2
Sam Chak
Sam Chak 2023년 6월 1일
Can you confirm if the data pair is absolutely governed by the dynamics?
Raffaele
Raffaele 2023년 6월 2일
편집: Raffaele 2023년 6월 2일
Actually the dynamic is more complicated, because there are also multiplications and divisions of the unknown parameters and also combination with other known parameters (like mass, spring stiffness, ecc.), like shown in my answer below. I just wrote that equation to simplify the presentation of the problem.

댓글을 달려면 로그인하십시오.

채택된 답변

Torsten
Torsten 2023년 6월 1일
편집: Torsten 2023년 6월 1일
Use "gradient" three times to get approximations for y', y'' and y''' in the points of your t-vector.
Let diff_y, diff_y2, diff_y3 be these approximations as column vectors of length n.
Now form a matrix A as
A = [diff_y2,diff_y,y]
and a column vector v as
v = [-y.^(3/2) - diff_y3]
Then approximations for a, b and c can be obtained using
sol = A\v
with
a = sol(1)
b = sol(2)
c = sol(3)
  댓글 수: 12
Raffaele
Raffaele 2023년 6월 3일
Thank you, so now I try to insert it in an lsqnonlin to find the best option for a, b, c
Torsten
Torsten 2023년 6월 3일
For the lsqnonlin fitting procedure, you can try two ways:
The first is without using the ode integrator and generating y',y'' and y''' from your data by using the "gradient" function.
The second is with the ode integrator by integrating the differential equation for given parameters a, b and c and by comparing the result with your given data for y.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by