How to solve ODE in which one variable depends on precedents variable states

2 次查看(过去 30 天)
Hi,
I would like to solve this equation
That is a 2nd order differential equation for a single degree of freedom oscillator.
I am using ode45 but the problem is to compute the restoring force . If the current time is denoted as t and the time step as , one has
Therefore, I need to store precedents variable states to compute and consequently to solve ODE. I read there is a possibility to use global variables and to have access to current time values utilized the option Output function. However, I'm not exactly sure how to use the Output function and, unfortunately, I didn't find any examples in which it was clear how to use it. Is there anyone that can share an example that suits me? I would like to specify I pass the interval of integration as a vector with two elements, namely the initial and final times.
Kind regards
Califfo

回答(1 个)

Steven Lord
Steven Lord 2020-5-22
It sounds like you don't have an ordinary differential equation (ODE) but a delay differential equation (DDE.)
If that's the case use a DDE solver rather than an ODE solver.
  2 个评论
Califfo
Califfo 2020-5-23
Hi Steven,
thank for your reply. I don't know these delay differential equations; I try to deepen the topic!
Califfo
Califfo 2020-5-23
Actually I don't know if it is what I need because just depends on the solutions evaluated in the previous step. I could use the DDE solver if I define the time step in order to define the delays in the system of equations as ... what do you think about that?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by