how to solve four sets of ode having four variables
2 次查看(过去 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!
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!