how to model a collision between two particles?

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).

답변 (1개)

Simon
Simon 2013년 11월 7일

0 개 추천

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

Hi, thanks for the answer!
I am simply using A<2 to find all values less than 2 in my distances matrix,which gives a mtrix made up of 1s and 0s
10
00
but then I am unsure how to use this information to 'combine' the values in our arrays.
Simon
Simon 2013년 11월 7일
Hi!
Could you show some more code? It might help to understand the problem.
How is your distance matrix built up? Is it symmetric? If so the diagonal elements may be the distances between a planet and itself, which is useless.
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 2013년 11월 7일
Then you simply take one planet with the sum of both masses and remove the second planet. Your calculations continue with one less planet.

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

카테고리

도움말 센터File Exchange에서 Earth and Planetary Science에 대해 자세히 알아보기

제품

질문:

2013년 11월 7일

댓글:

2013년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by