Effacer les filtres
Effacer les filtres

how to solve equation of motion?

3 vues (au cours des 30 derniers jours)
Emrys
Emrys le 10 Oct 2017
Commenté : Rena Berman le 30 Oct 2017
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 commentaire
Rena Berman
Rena Berman le 30 Oct 2017
(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 11 Oct 2017
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 commentaire
Walter Roberson
Walter Roberson le 11 Oct 2017
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));

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by