Electrostatic field calculation using R-functions and the method of characteristics in electrostatic precipitator