def calculate_N(self, max_structure_const, dt,
                    sigma, r_max, r_min):
        N = 0
        while True:
            N += 1
            grid_structure_interval = dt*(sigma**2)/(
                ((r_max-r_min)/float(N))**2)
            if grid_structure_interval > max_structure_const:
                break

        return N
dataset/ETHPy150Open jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_05_Codes/VasicekCZCB.py/VasicekCZCB.calculate_N/original