fix NaN bugs and invert particle friction parameter