One dimensional particle-in-cell simulation