Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download

Jupyter notebook 2015-09-30-R-value-calculation.ipynb

Project: ENSP 337
Views: 62
Kernel: Python 2 (SageMath)

The code below tells the computer that each of the variables (watt, ft, ...) represent a unit.

from pint import UnitRegistry u = UnitRegistry()
length = 30 * u.meter width = 30 * u.meter length * width
(length * width).to(u.feet**2)
K = ureg.degK m = ureg.m watt = ureg.watt ft = ureg.ft hour = ureg.hour BTU = ureg.BTU F = ureg.degR

This is the representation in mathematics

kwood=0.15wattKmk_{wood} = 0.15 \frac{watt}{K \cdot m}Rwood=twoodkwoodR_{wood} = \frac{t_{wood}}{k_{wood}}Rtotal=Rwood+Rfoam+RwoodR_{total} = R_{wood} + R_{foam} + R_{wood}

Below is an implementation of the calculation in Python code with units.

We define the conductivities of wood and foam using values from a table in Wikipedia. We also define the units.

k_wood = 0.15 * watt / K / m k_foam = 0.02 * watt / K / m

We define the thicknesses of the layers of wood and foam in the panel.

t_wood = 0.01 * m t_foam = 0.14 * m

We can then calculate the R-values for the a wood layer and a foam layer.

r_wood = t_wood / k_wood r_foam = t_foam / k_foam

The R-value is the sum of the layers. One wood, one foam, and then another wood layer.

r_SIP_SI = r_wood + r_foam + r_wood r_SIP_SI

We can multiply by a conversion factor to find the english R-value.

print(r_SIP_SI.magnitude * 5.68)
40.5173333333

The software we are using allows the computer to convert between these units. We see the numbers agree to 4 significant figures.

r_SIP_SI.to(ft**2 * hour / BTU * F)

We can also calculate the power lost by a large area of this wall.

Q=UAΔT=AΔTRtotalQ = UA\Delta T = \frac{A \Delta T}{R_{total}}
length = 50 * m height = 3 * m t_inside = 20 t_outside = 5 height * length / r_SIP_SI * (t_inside - t_outside) * K