how to solve four sets of ode having four variables

조회 수: 2 (최근 30일)
Vincent Ike
Vincent Ike 2021년 7월 16일
댓글: Steven Lord 2021년 7월 17일
The distinction in my question is that I need to put up such code with convective terms. As a student of MATLAB I have not been able to find such answers from past questions in the manner below. All derivatives are with respect to time. The variables are p, q, r, s. The equations are:
d^2p/dt^2 + d^2r/dt^2 +d^2s/dt^2 = p + 2*q + 3*r + 4*s
d^2q/dt^2 + d^2r/dt^2 +d^2s/dt^2 = p + 2*q + 3*r + 4*s
d^2p/dt^2 + d^2q/dt^2 + d^2r/dt^2 +d^2s/dt^2 = p + 2*q + 3*r + 4*s - 5*dr/dt - 5*ds/dt
d^2p/dt^2 + d^2q/dt^2 + d^2r/dt^2 +d^2s/dt^2 = p + 2*q + 3*r + 4*s - 5*dr/dt - 5*ds/dt
Initial conditions are all zero at t =dt = 0, i.e. p(0)=q(0)=r(0)=s(0) = 0. and dp(0)/dt=dq(0)/dt=dr(0)/dt=ds(0)/dt=0
I have spent a great deal of time trying with ode45. I need help on this, thanks in advance!

채택된 답변

Steven Lord
Steven Lord 2021년 7월 16일
Use the "Example: Nonstiff van der Pol Equation" example on this documentation page to rewrite each of your higher order ODEs into a system of first order ODEs (potentially with a mass matrix.) Then solve that larger system.
However, if we look at your equations, I suspect you're going to get nowhere fast. All your initial conditions (both the "position" and "velocity" terms being 0 at t = 0) makes me suspect you may only have the solution where all your functions are {p, q, r, s}(t) = 0.
The fact that your third and fourth equations are the same is also slightly suspicious.
  댓글 수: 4
Vincent Ike
Vincent Ike 2021년 7월 17일
The link you shared helped. Many thanks sir.
Steven Lord
Steven Lord 2021년 7월 17일
You're welcome.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by