how to solve equation of motion?

3 次查看(过去 30 天)
Emrys
Emrys 2017-10-10
评论: Rena Berman 2017-10-30
I have a problem with solving the equation of motion for a dinamic flow inside a square 0<q<2 0<p<2 in which i have dq/dt=2 dp/dt=r (r variable integer not time depending). How can I apply periodic boundary condition to this problem?

回答(1 个)

Walter Roberson
Walter Roberson 2017-10-11
Use event functions with ode45() or similar. The event functions should detect the boundary and halt the integration, and you would then restart the integration with the altered conditions. For example, you might check and find that q had reached 2, and then you would call ode45() again with the same dq/dt but the negative of the current dp/dt (for example)
You have not been clear as to how you want the periodic conditions to behave? Reverse the horizontal velocity? "bounce" using "angle of incidence = angle of reflection" ? Teleport to the other side of the box?
  1 个评论
Walter Roberson
Walter Roberson 2017-10-11
Still not enough information about what is to happen at the boundaries.
You said that r is an integer? The integral of a constant with respect to time is just the constant multiplied by the time, so if the periodic conditions are to just disappear from one side and reappear on the other, your conditions become equivalent to
q = mod(2 * t, 2)
p = mod(r * t, 2)
which is not ergotic for rational r. For integer r, the (q,p) pairs have a period of lcm(2, r) where lcm is lowest common multiple.
q = @(t) mod(2*t,2), p = @(t) mod(17*t,2);
t = linspace(0,500,1000);
scatter(q(t), p(t));

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by