how to model a collision between two particles?

3 Ansichten (letzte 30 Tage)
Bob Freeman
Bob Freeman am 7 Nov. 2013
Kommentiert: Simon am 7 Nov. 2013
Im modelling planetary motion, i have a matrix with all the distances between each of the planets so i can see whether any distances are less than a certain value. How do I combine the two planets (ie so i have one mass instead of two etc).

Antworten (1)

Simon
Simon am 7 Nov. 2013
Hi!
If you already found a distance below some value, do you know both planets involved? If so you just add in your matrix both masses, apply the combined mass to one of the plantes and remove the other one from the matrix.
  4 Kommentare
Bob Freeman
Bob Freeman am 7 Nov. 2013
Yes, you are right, the code is symmetric and the diagonal elements are useless. I have now managed to get a matrix with a value 1 if the distance is less than the specified limit, and 0 if not. I have also made the values along the diagonal 0.
I have used the find function to locate the position of the 1 values in the matrix, and therefore which planets it corresponds too. IE I have now managed to locate which planets are "colliding" and now want to create a single combined planet.
Simon
Simon am 7 Nov. 2013
Then you simply take one planet with the sum of both masses and remove the second planet. Your calculations continue with one less planet.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Earth and Planetary Science finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by