# Change Units in Regression Equation

Posted by Troy Williams on Sun 14 October 2018 Updated on Sun 14 October 2018

The purpose of this post is to explore the concept of changing the base units for a regression fit equation. Particularly the coefficients. The work is based on a paper called, "Prediction of Compressive Strength from Other Rock Properties."

## References

D'Andrea, D. V., et al. "Prediction of Compressive Strength from Other Rock Properties." United States Department of the Interior - Bureau of Mines, 1965.

## Target Equation

From the paper in the reference section, we'll use the following equation, equation 4 in the paper:

$$\sigma_{cs} = -7.442 + 14.445 \cdot \sigma_{ts} + 4.669 \cdot \rho + 3.877 \cdot \mu_{s} - 1.818 \cdot \epsilon_{s}$$

Where:
- $$\sigma_{cs}$$ - Static compressive strength $$\rightarrow 10^3 \cdot \text{psi}$$
- $$\sigma_{ts}$$ - Static tensile strength $$\rightarrow 10^3 \cdot \text{psi}$$
- $$\rho$$ - rock density (SG)
- $$\epsilon_{s}$$ - Young's Modulus $$\rightarrow 10^6 \cdot \text{psi}$$
- $$\mu_{s}$$ - Shear Modulus (Rigidity) $$\rightarrow 10^6 \cdot \text{psi}$$

We would like to modify the equation so that the input units are in Pascals and the output compressive strength is also in Pascals. If you notice, the static tensile and compressive strengths are not just in psi, they are in $$\rightarrow 10^3 \cdot \text{psi}$$. To make things more difficult, the shear modulus and Young's moduluse are in $$\rightarrow 10^6 \cdot \text{psi}$$. So not only do we have to contend with converting psi to Pa, we have to deal with different orders of magnitude.

## Simplify Equation

We'll simplify the equation somewhat by introducing variables for the coefficients to make things easier to read and manage:

$$\sigma_{cs} = -A + B \cdot \sigma_{ts} + C \cdot \rho + D \cdot \mu_{s} - E \cdot \epsilon_{s}$$

Where:
- $$\sigma_{cs}$$ - Static compressive strength $$\rightarrow 10^3 \cdot \text{psi}$$
- $$\sigma_{ts}$$ - Static tensile strength $$\rightarrow 10^3 \cdot \text{psi}$$
- $$\rho$$ - rock density (SG)
- $$\epsilon_{s}$$ - Young's Modulus $$\rightarrow 10^6 \cdot \text{psi}$$
- $$\mu_{s}$$ - Shear Modulus (Rigidity) $$\rightarrow 10^6 \cdot \text{psi}$$

Coefficients: - $$A = 7.442 \rightarrow 10^3 \text{psi}$$
- $$B = 14.445$$ - $$C = 4.669 \rightarrow 10^3 \text{psi}$$
- $$D = 3.877 \rightarrow 10^{-3}$$
- $$E = 1.818 \rightarrow 10^{-3}$$

NOTE: The coefficents do have units in some respects so that $$\sigma_{cs}$$ is in $$\left ( 10^3 \cdot \text{psi} \right )$$ when calculated.

## Data

From the paper, specifically table 1 (page 8) we'll use the following data:

Granite Gneiss tensile strength = 2.054 specific gravity = 2.65 shear modulus = 4.50 young's modulus = 10.93

Feeding those values directly into the equations yields: compressive strength = 32.1766 (psi x10^3) compressive strength = 32,176.6 (psi)

## Eliminate $$10^3$$

The first step in converting from psi to Pa is to remove one scaling factor from the equation. We want to format the equation and remove the $$10^3$$ scaling factor from the equation so that the results are directly in psi.

The equation becomes:

$$\sigma_{cs} = -A + B \cdot \sigma_{ts} + C \cdot \rho + D \cdot \mu_{s} - E \cdot \epsilon_{s}$$

Coefficients: - $$A = 7.442 \cdot 10^3 = 7442.0 \rightarrow \text{psi}$$
- $$B = 14.445$$
- $$C = 4.669 \cdot 10^3 = 4669.0 \rightarrow \text{psi}$$
- $$D = 3.877 \rightarrow 10^{-3}$$
- $$E = 1.818 \rightarrow 10^{-3}$$

The coefficients are modified as above. Notice that the coefficients for the shear modulus and Young's modulus still have a $$10^3$$ scaling factor. That means we still have to scale those values when entering them into the equation.

If you enter the data into this equation, scaling each of the values appropriately, you get the same answer.

## Remove Scaling from Shear and Young's Modulus

The equation becomes:

$$\sigma_{cs} = -A + B \cdot \sigma_{ts} + C \cdot \rho + D \cdot \mu_{s} - E \cdot \epsilon_{s}$$

Coefficients: - $$A = 7.442 \cdot 10^3 = 7442.0 \rightarrow \text{psi}$$
- $$B = 14.445$$
- $$C = 4.669 \cdot 10^3 = 4669.0 \rightarrow \text{psi}$$
- $$D = 3.877 \cdot 10^{-3} = 0.003877$$
- $$E = 1.818 \cdot 10^{-3} = 0.001818$$

Now the equation is formatted to accept input values in psi with no scaling factors.

## Convert to Pascals

The coefficients become:

$$A = \left( 7.442 \cdot 10^3 \right) \cdot 6894.76 \frac{\text{Pa}}{\text{psi}}$$
$$B = 14.445$$
$$C = \left( 4.669 \cdot 10^3 \right) \cdot 6894.76 \frac{\text{Pa}}{\text{psi}}$$
$$D = \left ( 3.877 \cdot 10^{-3} \right )$$
$$E = \left ( 1.818 \cdot 10^{-3} \right )$$

$$\sigma_{cs} = -A + B \cdot \sigma_{ts} + C \cdot \rho + D \cdot \mu_{s} - E \cdot \epsilon_{s}$$

Where:
- $$\sigma_{cs}$$ - Static compressive strength $$\left ( \text{Pa} \right )$$
- $$\sigma_{ts}$$ - Static tensile strength $$\left ( \text{Pa} \right )$$
- $$\epsilon_{s}$$ - Young's Modulus $$\left ( \text{Pa} \right )$$
- $$\mu_{s}$$ - Shear Modulus (Rigidity) $$\left ( \text{Pa} \right )$$
- $$\rho$$ - rock density (SG)

## Summary

It was a bit of a process to convert the regression equation from imperial units to metric. Now we can use straight metric values on the regression equation.

tags: math, jupyter