how to solve four sets of ode having four variables

5 次查看(过去 30 天)
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by