how to solve equation of motion?

조회 수: 1 (최근 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
Rena Berman
Rena Berman 2017년 10월 30일
(Answers Dev) Restored edit

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

답변 (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