calculate_rout function

Calculate r_out