# Estimation of viscosity from critical properties

The above graph represents reduced viscosity as a function of reduced temperature for several values of the reduced pressure.

I am writing a code which will estimate the viscosity, in the following steps :

1. Calculating critical viscosity($$\mu_c$$) by using the formula,

$$\mu_c = 7.70M^{0.5}p_c^{2/3}T_c^{-1/6}$$

1. Calculating reduced temperature and pressure as,

$$T_r = \frac{T}{T_c} \\ p_r = \frac{p}{p_c}$$

Now, from the graph at the top, estimating $$\mu_r$$ by using $$T_r$$ and $$p_r$$ values calculated from the previous step.

1. Finally, calculating the predicted value of $$\mu$$ as,

$$\mu = \mu_r\mu_c$$

(this value of $$\mu$$ is unusually a good agreement with the measured value)

## Question: How do I feed/extract the data/equation of the plot (top) which is experimentally generated so that I can also plot/test it in my code?

P.S - All other parameters $$T_c$$ , $$p_c$$ , $$T$$ , $$p$$, $$M$$ will be input by the user

REFERED : O. A. Uyehara and K. M. Wastson, Nat. Petroleum News, Tech. Section, 36, 764(Oct. 4, 1944); revised | Transport Phenomena, 2nd edition, R. Byron Bird, Warren E. Stewart, Edwin N. Lightfoot

You can use Plot Digitizer and extract the data points in your image graph as a xml file and then you can parse it by using Python. It's pretty straightforward. You need to import the image of your graph into the software. Then calibrate the X and Y axes by specifying the $$x_{min}$$, $$x_{max}$$, $$y_{min}$$, and $$y_{max}$$ which are the min and max of X and Y axes. Note that if X or Y axis is in logarithmic scale, you can specify it in the software during calibration. Finally you just manually touch the points in your graph and software would save the X and Y of points for you and you can easily import it as xml file and you can parse this xml file in Python or even in Microsoft Excel or LibreOffice.