Notices
Results 1 to 19 of 19

Thread: n-body problem with coordinate change

  1. #1 n-body problem with coordinate change 
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    I would like to model the motion of the planets as point size masses using matrices. I am not including moons, maybe later...Any help is much appreciated as I work through this

    The complete graph with 10 nodes shows 45 edges.

    10nodes.jpg

    This graph is directed if along every edge the orientation is taken to be X( na to nb < na) is negative.
    Numbering the massive bodies, I number starting at 1 for the sun and give pluto node number 10.

    Such that

    X14 indicates the vector pointing from the sun to mars with the negative direction being toward the sun.

    The position of each node in R3 is given by the vector Xi(t) = [Xi1, Xi2, Xi3] with initial positions Xio at t = to.

    The force vector F, between any two nodes is Fij and is proportional to the product of the masses of nodes i and j, divided by the ||Xij||^2.

    Assume continuous and differentiable in all dimensions.


    dx/dt = V
    dV/dt = A = d2x/d2t

    And Fij(t) = k*mi*mj * (xij hat) / (xij)^2

    Even though this matrx Fij is 45 dimensions I can tell that it will be symmetrical and singular, since all terms Fii are zero and that the rank of the matrix will be 44 ( I think) leaving a nullspace of 1 dimension.


    will stop here for now as I am having trouble seeing the equation in the form Ax= b. My first thought is to rearrange it in someway but the method is not clear to me. I am seeing exponents in a matrix equation so I am thinking this has to do with eigen values somehow, bu the matrix is singular.
    Attached Images


    Last edited by ReMakeIt; February 4th, 2012 at 05:48 AM. Reason: 4-1=3
    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    Oh and the coordinate change will be later, I want to move the final model in to a rotating coordinate system.


    Reply With Quote  
     

  4. #3  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    I am not clear as to how this is meant to work. What is the physical meaning of the matrix F ? Matrix multiplication Fx will yield another matrix b - what is its meaning ?
    Are you attempting to model just the general shape of the solar system ?
    Reply With Quote  
     

  5. #4  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    Yes, I want a way so see the force components from each body on all the other bodies as a function of time later I want to add centripital force to this diagram than ty to cancel it using a different reference frame. My maths are at their limit here so I am not sure what this will look like in the end. I have an idea. Also I just realized that the matrix may not be singular

    0 n m
    -n 0 p
    -m -p 0

    reduces to

    n n m-p
    0 n 2m+p
    0 0 -m^2 +p^2 -m^2n +pm/n

    (close enough)
    which is nonsingular
    Last edited by ReMakeIt; February 4th, 2012 at 06:08 AM.
    Reply With Quote  
     

  6. #5  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Quote Originally Posted by ReMakeIt View Post
    Yes, I want a way so see the force components from each body on all the other bodies as a function of time later I want to add centripital force to this diagram than ty to cancel it using a different reference frame. My maths are at their limit here so I am not sure what this will look like in the end. I have an idea.
    Ok, I see.
    I don't doubt that this might work, however, I think the transformation matrix to get from state A to state B will become very complicated because the bodies interact with each other as well, not just with the sun. In essence we are going to have a system of differential equations of the form



    wherein m is the body masses, q are the position vectors, and F represent the forces between the bodies. The solutions will be the time-parametrized orbits q(t) for each body. This can be rewritten and re-arranged into a matrix equation of rank 10.
    Reply With Quote  
     

  7. #6  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Just by looking at it, I am beginning to doubt that this system of ODEs has a closed analytical solution. You might get stuck with a numerical model here. The F would be of the form



    or something similar, according to Newton ( the q are all vectors, of course ).
    Reply With Quote  
     

  8. #7  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    Yes, the notation is clear, thanks this looks like the perfect problem for me to stretch my brain. Even in the case of a non specific solution the work will be the reward.
    Reply With Quote  
     

  9. #8  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Quote Originally Posted by ReMakeIt View Post
    Yes, the notation is clear, thanks this looks like the perfect problem for me to stretch my brain. Even in the case of a non specific solution the work will be the reward.
    I agree, this is sure going to be a challenge !!
    Let us know how you get on...I know what the n-body problem looks like, but have never actually attempted a solution, not with anything more than two bodies at a time anyway. I'm quite curious to know how you are going to tackle that system of equations !
    Reply With Quote  
     

  10. #9  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,998
    As far as I know, an exact analytical solution to the n-body problem is impossible (for n > 3). This is why numerical methods are used. What you propose looks like it could be a usable form for use in a simulation (I don't know about efficiency).
    ei incumbit probatio qui dicit, non qui negat
    Reply With Quote  
     

  11. #10  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    The complete graph gives this adjacency matrix, A:

    0 1 1 1 1 1 1 1 1 1
    -1 0 1 1 1 1 1 1 1 1
    -1 -1 0 1 1 1 1 1 1 1
    -1 -1 -1 0 1 1 1 1 1 1
    -1 -1 -1 -1 0 1 1 1 1 1
    -1 -1 -1 -1 -1 0 1 1 1 1
    -1 -1 -1 -1 -1 -1 0 1 1 1
    -1 -1 -1 -1 -1 -1 -1 0 1 1
    -1 -1 -1 -1 -1 -1 -1 -1 0 1
    -1 -1 -1 -1 -1 -1 -1 -1 -1 0

    which has determinate 1, trace 0 and no real eigenvalues
    It has full rank and is invertible.

    Now I have a question. The mass of each planet if placed in to a vector notation M = [m1,m2...mn], gives the right mass components to the final equations in the form:

    MMT

    The problem I have with that is that mass is a scalar not a vector so I don't know if mass can be operated on like this and what it means to do so.

    And the hadamard product A, MMT gives the matrix B where bij = mi*mj * sign of force.

    If it does make sense to work with the matrix this way I need another matrix which I can take the hadamard product B, C. Where C has the values of (xi-xj)/(xi-xj)3 or similarly, 1/xiTxj.

    One way I can get the matrix D containing the right (xi-xj) term is by taking D = X*vec{1}T- vec{1}*XT

    Where vec{1} is a vector containing all ones.
    Now to get the final matrix equation:

    F = ((A, MMT), C)

    Where C is some combination of matrix D like D/D3 which I am still trying to figure out.
    Last edited by ReMakeIt; February 5th, 2012 at 12:08 AM.
    Reply With Quote  
     

  12. #11  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Quote Originally Posted by ReMakeIt View Post
    The complete graph gives this adjacency matrix, A:

    0 1 1 1 1 1 1 1 1 1
    -1 0 1 1 1 1 1 1 1 1
    -1 -1 0 1 1 1 1 1 1 1
    -1 -1 -1 0 1 1 1 1 1 1
    -1 -1 -1 -1 0 1 1 1 1 1
    -1 -1 -1 -1 -1 0 1 1 1 1
    -1 -1 -1 -1 -1 -1 0 1 1 1
    -1 -1 -1 -1 -1 -1 -1 0 1 1
    -1 -1 -1 -1 -1 -1 -1 -1 0 1
    -1 -1 -1 -1 -1 -1 -1 -1 -1 0

    which has determinate 1, trace 0 and no real eigenvalues
    It has full rank and is invertible.

    Now I have a question. The mass of each planet if placed in to a vector notation M = [m1,m2...mn], gives the right mass components to the final equations in the form:

    MMT

    The problem I have with that is that mass is a scalar not a vector so I don't know if mass can be operated on like this and what it means to do so.

    And the hadamard product A, MMT gives the matrix B where bij = mi*mj * sign of force.

    If it does make sense to work with the matrix this way I need another matrix which I can take the hadamard product B, C. Where C has the values of (xi-xj)/(xi-xj)3 or similarly, 1/xiTxj.

    One way I can get the matrix D containing the right (xi-xj) term is by taking D = X*vec{1}T- vec{1}*XT

    Where vec{1} is a vector containing all ones.
    Now to get the final matrix equation:

    F = ((A, MMT), C)

    Where C is some combination of matrix D like D/D3 which I am still trying to figure out.
    I think I lost you here now. The differential equations governing the planetary orbits are actually non-linear, so not sure how far you are going to get with these matrices...
    Reply With Quote  
     

  13. #12  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    I also see that this is not the way it is done, something is very strange about the way I am going about this, I will continue until I see where I went wrong.
    Reply With Quote  
     

  14. #13  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    After staring at this for some time today I came up with some ideas:

    The adjacency matrix in this case is not represented by the matrix with 1, 0, and -1 in the case where the nodes have mass and definite positions. So,
    0 1 1 1 1 1 1 1 1 1
    -1 0 1 1 1 1 1 1 1 1
    -1 -1 0 1 1 1 1 1 1 1
    -1 -1 -1 0 1 1 1 1 1 1
    -1 -1 -1 -1 0 1 1 1 1 1
    -1 -1 -1 -1 -1 0 1 1 1 1
    -1 -1 -1 -1 -1 -1 0 1 1 1
    -1 -1 -1 -1 -1 -1 -1 0 1 1
    -1 -1 -1 -1 -1 -1 -1 -1 0 1
    -1 -1 -1 -1 -1 -1 -1 -1 -1 0

    becomes the matrix with the form:

    Fmatrix.JPG


    which exhibits the same sign behavior as the 1,0,-1 matrix, notice the diagonal terms coming from the force of a mass acting on itself which would be zero, and the anti-symmetrical behavior or the other components.

    Notice that the sum of the terms in the first row is the same as F(x1) = Sum (m1mi* (x1-xi)/(x1-xi)3)

    What I am trying to do now is see this matrix as the outer product of 2 vectors.

    Notice that if I take the outer product of two vectors M and MT

    M1 * M1 M2 M3 M4 = M12 M1M2 M1M3 M1M4
    M2 |_____________M2M1 M22 M2M3 M2M4
    M3
    |_________________ M3M1 M3M2 M32 M3M4
    M4 |_____________M4M1 M4M2 M4M3 M42



    And these are the coefficients I want but since mass at a point is not a vector quantity something else is needed in the vectors used to make the outer product.
    Last edited by ReMakeIt; February 6th, 2012 at 02:49 AM. Reason: adding attachment
    Reply With Quote  
     

  15. #14  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    Also, the Final force vector should not be a matrix but each of those sums should be a member of the vector

    So that

    F(x1) = Sum (m1mi* (x1-xi)/(x1-xi)3)
    F(x2) = Sum (m2mi* (x2-xi)/(x2-xi)3)
    F(x3) = Sum (m3mi* (x3-xi)/(x3-xi)3)
    F(x4) = Sum (m4mi* (x4-xi)/(x4-xi)3).
    .
    .
    .


    Which means that the force vector should be the dot product of 2 matrix, which included the values of the MMT expansion. What I am after here is the outer product of two vectors, U and V, which develops the matrix A which operates on the vector X and gives the force vector F

    VUT*X = AX = F
    Reply With Quote  
     

  16. #15  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Quote Originally Posted by ReMakeIt View Post
    Also, the Final force vector should not be a matrix but each of those sums should be a member of the vector

    So that

    F(x1) = Sum (m1mi* (x1-xi)/(x1-xi)3)
    F(x2) = Sum (m2mi* (x2-xi)/(x2-xi)3)
    F(x3) = Sum (m3mi* (x3-xi)/(x3-xi)3)
    F(x4) = Sum (m4mi* (x4-xi)/(x4-xi)3).
    .
    .
    .


    Which means that the force vector should be the dot product of 2 matrix, which included the values of the MMT expansion. What I am after here is the outer product of two vectors, U and V, which develops the matrix A which operates on the vector X and gives the force vector F

    VUT*X = AX = F
    That's pretty much the idea. Remember though that we you need to get is 10 vectors, one for each of the planets. With these vectors you can then calculate the actual orbits via F=ma.
    Reply With Quote  
     

  17. #16  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126


    in matrix form







    Mass matrix M and acceleration matrix A:

    ;

    And





    Reply With Quote  
     

  18. #17  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126
    The A11 term shows the acceleration from object 1 to object 1 and is zero, but since the direction of the acceleration is in the direction if its position it is zero.

    The A12 and A21 term show opposite magnitude along the X1 --> X2 line.

    Now i need a matrix which will take the contributions along these vectors and normalize them to a standard basis in R3.
    Reply With Quote  
     

  19. #18  
    Moderator Moderator Markus Hanke's Avatar
    Join Date
    Nov 2011
    Location
    Ireland
    Posts
    7,302
    Quote Originally Posted by ReMakeIt View Post
    The A11 term shows the acceleration from object 1 to object 1 and is zero, but since the direction of the acceleration is in the direction if its position it is zero.

    The A12 and A21 term show opposite magnitude along the X1 --> X2 line.

    Now i need a matrix which will take the contributions along these vectors and normalize them to a standard basis in R3.
    Where are the differentials ?
    Reply With Quote  
     

  20. #19  
    Forum Sophomore ReMakeIt's Avatar
    Join Date
    Jan 2012
    Posts
    126



    Back to this bleh... still want to find a better form. There has to be some method of simplifying this...
    Reply With Quote  
     

Similar Threads

  1. Replies: 0
    Last Post: October 10th, 2011, 09:51 AM
  2. Brain to body or body to brain communication question?
    By Whataday in forum Pseudoscience
    Replies: 76
    Last Post: November 15th, 2010, 01:20 PM
  3. objects can't share a coordinate
    By miomaz in forum Physics
    Replies: 0
    Last Post: January 6th, 2008, 11:56 AM
  4. Three body problem
    By milija in forum Physics
    Replies: 1
    Last Post: November 26th, 2007, 03:10 PM
  5. Need help for my c code, about two body problem
    By newbie in forum Computer Science
    Replies: 0
    Last Post: August 24th, 2007, 06:38 AM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •