How to fix ‘RuntimeWarning: divide by zero encountered in double_scalars’
Those are not actual errors, but warnings. They are there because you are trying to divide something by zero. Namely, you are setting M[0] = 0 and then dividing by M[0] (at first iteration, where m = 0) and same for P[0]. The question is, what do you want the first values to be? Maybe a solution would be initialize the … Read more