Fully elastic collisions

Discussion in 'Modeling' started by Pim, Mar 18, 2018.

  1. Pim

    Pim

    Hi,

    Is there any way in which objects can collide fully elastically?

    I use the model attached and set in the first time step the velocities to (4, 4) and (4, -4) The balls then move diagonally towards each other and collide. After collision they have however lost much of their energy. I have set condim to 1 to remove friction, but this did not help.

    Thanks!

    Code:
    <mujoco>
        <worldbody>
            <body>
                <geom type="sphere" pos="0 0 0" size="1" condim="1"/>
                <joint axis="1 0 0" type="slide"/>
                <joint axis="0 1 0" type="slide"/>
            </body>
            <body>
                <geom type="sphere" pos="0 3 0" size="1" condim="1"/>
                <joint axis="1 0 0" type="slide"/>
                <joint axis="0 1 0" type="slide"/>
            </body>
        </worldbody>
    </mujoco>
    
     
    Last edited: Mar 19, 2018
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    This is because default contacts are inelastic in the normal direction (even in the absence of friction). You have to adjust the solref parameters of the contacts to make them elastic. In particular, reduce the damping coefficient (second number in solref). These parameters are not in one-to-one correspondence with the coefficient of restitution, but you can achieve a desired restitution qualitatively. Note that reducing the damping coefficient can make the simulation unstable.
     
    Kyokushin and Pim like this.
  3. Pim

    Pim

    Great, that helps a lot. Thanks
     
  4. Hi,

    I'm also trying to model an elastic collision. Following the advice, I don't get much of a bounce even when the damping coefficient is very small.
    Code:
    <mujoco model="ball paddle">
      <worldbody>
        <light name="light" directional="true" diffuse=".6 .6 .6" pos="0 0 2" specular=".3 .3 .3"/>
        <geom name="ground" type="plane" pos="0 0 0" size=".6 .2 10" material="grid"/>
    
        <body name="ball" pos="0 0 .6">
          <joint name="ball_joint" type="free" />
          <geom name="ball" type="sphere" size=".025" material="effector" solref="0.02 0.001"/>
        </body>
      </worldbody>
    </mujoco>
    
    Here's what it looks like. Are there other parameters that I should be looking at? Thanks!

    ball_bounce.gif
     
  5. Emo Todorov

    Emo Todorov Administrator Staff Member

  6. that works, thanks!