Is the the derivation of the following motion equation correct?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Suppose I have an undirected graph $G = (V,E)$, suppose $|V| = m$ and for each such vertex we associate a point mass $Q_1,ldots Q_m$. Now we connect $Q_i$ and $Q_j$ with a spring if and only if $(Q_i,Q_j) in E$.



Now imagine you have such system (call it a mesh) in space, no movement at first. So basically the kinetic energy of the system is given by



$$
T = sum_Q_i frac12lVert Q_i' rVert^2
$$



Assume we are in a vector field defined as



$$
U(Q_i) = k_r sqrtx_i^2 + y_i^2 + k_g z_i
$$



the total amount of potential energy is given by



$$
V = sum_i U(Q_i) + k_e sum_i sum_j in mathcalN(i) left(lVert Q_i - Q_j rVert - l_ij right)^2
$$



The motion equation can be derived by setting
$$
0 = fracpartial Vpartial Q_i + fracddtfracpartial Tpartial Q_i'
$$



And such equation leads me to



$$
0 = k_g hate_3 + k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert + k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert + Q_i''
$$



And this lead me to the motion equation



$$
Q_i'' = -k_g hate_3 - k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert - k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert
$$



Is the equation correct?
(I'm currently simulating it and I'm getting weird results, like instabilities).



What I'm trying to simulate is essentially like stretching some elastic material, assuming it is modelled with a triangular mesh where each triangle's edge has a spring connecting the two adjacent vertices.



The assumptions are uniform mass, I think even considering it it would cancel out.










share|cite|improve this question

























    up vote
    0
    down vote

    favorite












    Suppose I have an undirected graph $G = (V,E)$, suppose $|V| = m$ and for each such vertex we associate a point mass $Q_1,ldots Q_m$. Now we connect $Q_i$ and $Q_j$ with a spring if and only if $(Q_i,Q_j) in E$.



    Now imagine you have such system (call it a mesh) in space, no movement at first. So basically the kinetic energy of the system is given by



    $$
    T = sum_Q_i frac12lVert Q_i' rVert^2
    $$



    Assume we are in a vector field defined as



    $$
    U(Q_i) = k_r sqrtx_i^2 + y_i^2 + k_g z_i
    $$



    the total amount of potential energy is given by



    $$
    V = sum_i U(Q_i) + k_e sum_i sum_j in mathcalN(i) left(lVert Q_i - Q_j rVert - l_ij right)^2
    $$



    The motion equation can be derived by setting
    $$
    0 = fracpartial Vpartial Q_i + fracddtfracpartial Tpartial Q_i'
    $$



    And such equation leads me to



    $$
    0 = k_g hate_3 + k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert + k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert + Q_i''
    $$



    And this lead me to the motion equation



    $$
    Q_i'' = -k_g hate_3 - k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert - k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert
    $$



    Is the equation correct?
    (I'm currently simulating it and I'm getting weird results, like instabilities).



    What I'm trying to simulate is essentially like stretching some elastic material, assuming it is modelled with a triangular mesh where each triangle's edge has a spring connecting the two adjacent vertices.



    The assumptions are uniform mass, I think even considering it it would cancel out.










    share|cite|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Suppose I have an undirected graph $G = (V,E)$, suppose $|V| = m$ and for each such vertex we associate a point mass $Q_1,ldots Q_m$. Now we connect $Q_i$ and $Q_j$ with a spring if and only if $(Q_i,Q_j) in E$.



      Now imagine you have such system (call it a mesh) in space, no movement at first. So basically the kinetic energy of the system is given by



      $$
      T = sum_Q_i frac12lVert Q_i' rVert^2
      $$



      Assume we are in a vector field defined as



      $$
      U(Q_i) = k_r sqrtx_i^2 + y_i^2 + k_g z_i
      $$



      the total amount of potential energy is given by



      $$
      V = sum_i U(Q_i) + k_e sum_i sum_j in mathcalN(i) left(lVert Q_i - Q_j rVert - l_ij right)^2
      $$



      The motion equation can be derived by setting
      $$
      0 = fracpartial Vpartial Q_i + fracddtfracpartial Tpartial Q_i'
      $$



      And such equation leads me to



      $$
      0 = k_g hate_3 + k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert + k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert + Q_i''
      $$



      And this lead me to the motion equation



      $$
      Q_i'' = -k_g hate_3 - k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert - k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert
      $$



      Is the equation correct?
      (I'm currently simulating it and I'm getting weird results, like instabilities).



      What I'm trying to simulate is essentially like stretching some elastic material, assuming it is modelled with a triangular mesh where each triangle's edge has a spring connecting the two adjacent vertices.



      The assumptions are uniform mass, I think even considering it it would cancel out.










      share|cite|improve this question













      Suppose I have an undirected graph $G = (V,E)$, suppose $|V| = m$ and for each such vertex we associate a point mass $Q_1,ldots Q_m$. Now we connect $Q_i$ and $Q_j$ with a spring if and only if $(Q_i,Q_j) in E$.



      Now imagine you have such system (call it a mesh) in space, no movement at first. So basically the kinetic energy of the system is given by



      $$
      T = sum_Q_i frac12lVert Q_i' rVert^2
      $$



      Assume we are in a vector field defined as



      $$
      U(Q_i) = k_r sqrtx_i^2 + y_i^2 + k_g z_i
      $$



      the total amount of potential energy is given by



      $$
      V = sum_i U(Q_i) + k_e sum_i sum_j in mathcalN(i) left(lVert Q_i - Q_j rVert - l_ij right)^2
      $$



      The motion equation can be derived by setting
      $$
      0 = fracpartial Vpartial Q_i + fracddtfracpartial Tpartial Q_i'
      $$



      And such equation leads me to



      $$
      0 = k_g hate_3 + k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert + k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert + Q_i''
      $$



      And this lead me to the motion equation



      $$
      Q_i'' = -k_g hate_3 - k_r fractextProj_span(e_1,e_2) Q_ilVert textProj_span(e_1,e_2) Q_i rVert - k_e sum_j in mathcalNi left(lVert Q_i - Q_j rVert - l_ij right) fracQ_i - Q_jlVert Q_i - Q_j rVert
      $$



      Is the equation correct?
      (I'm currently simulating it and I'm getting weird results, like instabilities).



      What I'm trying to simulate is essentially like stretching some elastic material, assuming it is modelled with a triangular mesh where each triangle's edge has a spring connecting the two adjacent vertices.



      The assumptions are uniform mass, I think even considering it it would cancel out.







      graph-theory physics classical-mechanics euler-lagrange-equation






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Sep 3 at 14:32









      user8469759

      1,1801515




      1,1801515




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Yes, a few things. First off, you used the potential energy of a deflected linear spring to be $k Delta x^2$, but it's actually $frac12 k Delta x^2$. Secondly, I think deriving the equation of motion for an individual vertex using $F=ma$ is much easier here. You can then just write the equation of motion for an individual particle as:



          $$-nabla U(Q_i) + sum_j in mathcalN(i) k_ij (||Q_i-Q_j||-l_ij) fracQ_j-Q_i = m_i Q''_i
          $$



          Then, if you're encountering stability issues, I would recommend checking that you're using a stable integrator. For equations like this, the Leapfrog or Verlet integrator is common. Leapfrog is easy to implement (explicit), accurate, and stable.






          share|cite|improve this answer




















          • What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
            – user8469759
            Sep 3 at 15:36











          • By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
            – Gavin Ridley
            Sep 3 at 15:59











          • Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
            – user8469759
            Sep 3 at 16:01










          • Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
            – Gavin Ridley
            Sep 3 at 17:54










          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "69"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2903927%2fis-the-the-derivation-of-the-following-motion-equation-correct%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          Yes, a few things. First off, you used the potential energy of a deflected linear spring to be $k Delta x^2$, but it's actually $frac12 k Delta x^2$. Secondly, I think deriving the equation of motion for an individual vertex using $F=ma$ is much easier here. You can then just write the equation of motion for an individual particle as:



          $$-nabla U(Q_i) + sum_j in mathcalN(i) k_ij (||Q_i-Q_j||-l_ij) fracQ_j-Q_i = m_i Q''_i
          $$



          Then, if you're encountering stability issues, I would recommend checking that you're using a stable integrator. For equations like this, the Leapfrog or Verlet integrator is common. Leapfrog is easy to implement (explicit), accurate, and stable.






          share|cite|improve this answer




















          • What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
            – user8469759
            Sep 3 at 15:36











          • By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
            – Gavin Ridley
            Sep 3 at 15:59











          • Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
            – user8469759
            Sep 3 at 16:01










          • Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
            – Gavin Ridley
            Sep 3 at 17:54














          up vote
          2
          down vote



          accepted










          Yes, a few things. First off, you used the potential energy of a deflected linear spring to be $k Delta x^2$, but it's actually $frac12 k Delta x^2$. Secondly, I think deriving the equation of motion for an individual vertex using $F=ma$ is much easier here. You can then just write the equation of motion for an individual particle as:



          $$-nabla U(Q_i) + sum_j in mathcalN(i) k_ij (||Q_i-Q_j||-l_ij) fracQ_j-Q_i = m_i Q''_i
          $$



          Then, if you're encountering stability issues, I would recommend checking that you're using a stable integrator. For equations like this, the Leapfrog or Verlet integrator is common. Leapfrog is easy to implement (explicit), accurate, and stable.






          share|cite|improve this answer




















          • What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
            – user8469759
            Sep 3 at 15:36











          • By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
            – Gavin Ridley
            Sep 3 at 15:59











          • Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
            – user8469759
            Sep 3 at 16:01










          • Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
            – Gavin Ridley
            Sep 3 at 17:54












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Yes, a few things. First off, you used the potential energy of a deflected linear spring to be $k Delta x^2$, but it's actually $frac12 k Delta x^2$. Secondly, I think deriving the equation of motion for an individual vertex using $F=ma$ is much easier here. You can then just write the equation of motion for an individual particle as:



          $$-nabla U(Q_i) + sum_j in mathcalN(i) k_ij (||Q_i-Q_j||-l_ij) fracQ_j-Q_i = m_i Q''_i
          $$



          Then, if you're encountering stability issues, I would recommend checking that you're using a stable integrator. For equations like this, the Leapfrog or Verlet integrator is common. Leapfrog is easy to implement (explicit), accurate, and stable.






          share|cite|improve this answer












          Yes, a few things. First off, you used the potential energy of a deflected linear spring to be $k Delta x^2$, but it's actually $frac12 k Delta x^2$. Secondly, I think deriving the equation of motion for an individual vertex using $F=ma$ is much easier here. You can then just write the equation of motion for an individual particle as:



          $$-nabla U(Q_i) + sum_j in mathcalN(i) k_ij (||Q_i-Q_j||-l_ij) fracQ_j-Q_i = m_i Q''_i
          $$



          Then, if you're encountering stability issues, I would recommend checking that you're using a stable integrator. For equations like this, the Leapfrog or Verlet integrator is common. Leapfrog is easy to implement (explicit), accurate, and stable.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Sep 3 at 15:23









          Gavin Ridley

          584




          584











          • What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
            – user8469759
            Sep 3 at 15:36











          • By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
            – Gavin Ridley
            Sep 3 at 15:59











          • Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
            – user8469759
            Sep 3 at 16:01










          • Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
            – Gavin Ridley
            Sep 3 at 17:54
















          • What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
            – user8469759
            Sep 3 at 15:36











          • By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
            – Gavin Ridley
            Sep 3 at 15:59











          • Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
            – user8469759
            Sep 3 at 16:01










          • Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
            – Gavin Ridley
            Sep 3 at 17:54















          What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
          – user8469759
          Sep 3 at 15:36





          What do you mean with "equations like this"? (Just for reference). I also believe I might have stability issues (since I'm using a first order integrator).
          – user8469759
          Sep 3 at 15:36













          By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
          – Gavin Ridley
          Sep 3 at 15:59





          By "like this", I mean large systems of second order equations usually associated with a many body dynamics simulation.
          – Gavin Ridley
          Sep 3 at 15:59













          Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
          – user8469759
          Sep 3 at 16:01




          Just a side question, a large $k_ij$ compared to the other quantities should imply the body isn't very elastic right? If my force is constant the more I increase $k$ the harder should be to deform the spring right?
          – user8469759
          Sep 3 at 16:01












          Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
          – Gavin Ridley
          Sep 3 at 17:54




          Indeed! It's the amount of force per unit deflection that the spring exerts. Larger $k$ makes more resistance to compression for smaller compressions. This is only a linear approximation though, and breaks down at large deflections. Check this out. en.wikipedia.org/wiki/Hooke%27s_law
          – Gavin Ridley
          Sep 3 at 17:54

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2903927%2fis-the-the-derivation-of-the-following-motion-equation-correct%23new-answer', 'question_page');

          );

          Post as a guest













































































          這個網誌中的熱門文章

          How to combine Bézier curves to a surface?

          Mutual Information Always Non-negative

          Why am i infinitely getting the same tweet with the Twitter Search API?