Commit e4349d59 authored by hazrmard's avatar hazrmard
Browse files

modelled MLP for cooling tower, split relationship/models notebooks

parent 2f0486ac
Loading
Loading
Loading
Loading
+2 −0
Changes for docs/5-dataset.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ And the following derived fields:

1. `PowIn`: Total input power calculated as a sum of all power fields.

2. `PowCool`: Rate of heat energy extracted by the evaporator from water coming from living spaces.


## Datasets

+38 −0
Changes for docs/7-relationships.md: 38 added lines, 0 removed lines.
Original line number Diff line number Diff line
---
title: 'Relationships: Cooling Tower'
order: 7
hasequations: true
---

## Correlations

### Fan speed and power consumption

*Hypothesis*: Fan power, `PowFan[A | B]` depends on ambient temperature `TempAmbient`, relative humidity `PerHumidity`, and fan speed setting `PerFreqFan[A | B]`.

A pipeline was set up where first the three features were normalized to [0-1] range. Then they were trained on a 90-10 training testing split. The coefficient of determination, $R^2 = 0.04$ indicating that the model simply predicts the mean power consumption. There is no strong linear relationship between the features and power consumption. *However*, this model is not conclusive as the data contain measurements mostly for when fan speed is near 100%. The model, as it is, simply shows that it cannot capture the noise in measurements - which is to be expected.

![Fan power vs temp vs humidity](img/7-fan-power-vs-temp-humidity.png)

## Clustering

The features are clustered to extract if there are any separate modes of operation.

### Temperature

Cooling tower measurements are clustered using [DBSCAN][1] on `TempAmbient`, `TempWetbulb`, and `DeltaTemp = TempCondOut - TempCondIn`. The following animation shows clustering results:

![clusters](img/7-ct-temp-clusters.gif)

All three temperature measurements occupy a planar space. Deviation from the plane can be used as a basis for identifying anomalous operation.

### Power

Cooling tower measurements are clustered using [DBSCAN][1] on `PowConP`, `PowFanA`, and `PowFanB`. The following animation shows clustering results:

![clusters](img/7-ct-power-clusters.gif)

On default options, no clusters are found. However, most of the power states are distributed along high power consumption for the two fans. The condenser water pump shows an even distribution across measurements. In this case, the concentration around high fan power makes sense as the source data mostly had fan power set to 100% of maximum frequency.


[1]: http://scikit-learn.org/stable/modules/clustering.html#dbscan
 No newline at end of file
+28 −58
Changes for docs/8-models.md: 28 added lines, 58 removed lines.
Original line number Diff line number Diff line
---
title: 'Analysis: Cooling Tower'
order: 7
title: 'Cooling Tower Models'
order: 8
hasequations: true
---

@@ -32,63 +32,10 @@ Condenser | | Cooling |
-----------/     (TempCondIn, T_L, Cold water)   \__________/
```

## Coefficient of performance

The theoretical maximum [Coefficient of Performance (COP)][1] is then:

$$
COP_{max} = \frac{T_L}{T_H - T_L}
$$

The achieved COP is the ratio of the energy extracted from the water to the electrical input to the cooling tower.

$$
COP = \frac{c_m m (T_H - T_L)}{E_{electrical}}
$$

Where:

* $c_m$ is the specific mass heat capacity of water i.e. energy required to heat $1g$ of water by $1 K$.
* $m$ is the mass of water being cooled.
* $T_H, T_L$ are high and low temperatures of water `TCondOut` and `TCondIn` respectively.
* $\text{Tons, PowConP, PowFanA, PowFanB}$ are all in watts.

Instead of mass and energy, mass flow rate and power can be used.

Instead of mass and energy, volumetric flow rate, power, and specific *volumetric* heat capacity can be used.

## Modelling fan speed and power consumption

*Hypothesis*: Fan power, `PowFan[A | B]` depends on ambient temperature `TempAmbient`, relative humidity `PerHumidity`, and fan speed setting `PerFreqFan[A | B]`.

### Linear regression model

A pipeline was set up where first the three features were normalized to [0-1] range. Then they were trained on a 90-10 training testing split. The coefficient of determination, $R^2 = 0.04$ indicating that the model simply predicts the mean power consumption. There is no strong linear relationship between the features and power consumption. *However*, this model is not conclusive as the data contain measurements mostly for when fan speed is near 100%. The model, as it is, simply shows that it cannot capture the noise in measurements - which is to be expected.

![Fan power vs temp vs humidity](img/7-fan-power-vs-temp-humidity.png)

## Clustering

The features are clustered to extract if there are any separate modes of operation.

### Temperature

Cooling tower measurements are clustered using [DBSCAN][2] on `TempAmbient`, `TempWetbulb`, and `DeltaTemp = TempCondOut - TempCondIn`. The following animation shows clustering results:

![clusters](img/7-ct-temp-clusters.gif)

All three temperature measurements occupy a planar space. Deviation from the plane can be used as a basis for identifying anomalous operation.

### Power

Cooling tower measurements are clustered using [DBSCAN][2] on `PowConP`, `PowFanA`, and `PowFanB`. The following animation shows clustering results:

![clusters](img/7-ct-power-clusters.gif)

On default options, no clusters are found. However, most of the power states are distributed along high power consumption for the two fans. The condenser water pump shows an even distribution across measurements. In this case, the concentration around high fan power makes sense as the source data mostly had fan power set to 100% of maximum frequency.

## Evaporative cooling model

A model can be developed to predict the temperature of cooled water from a host of variables.

The rate of evaporative cooling (watts) depends on:

* *Liquid temperature* $T(t)$ - more evaporation at *higher* water temperatures.
@@ -134,5 +81,28 @@ $m$ is held constant for a "parcel" of liquid being considered.

$T(t_{evap}) = \texttt{TempCondIn}$ and $T(0) = \texttt{TempCondOut}$ from the dataset.

This model makes several assumptions:

* Cooling is modelled from a stationary packet of water. Energy is lost to the environment. This does not account for convection/conduction to warmer water entering or cooler water exiting the cooling tower. However, if the temperature gradient across the body of water is small, these effects may be neglegible.

* All proportionality relationships are assumed to be first-order. That may not be the case in reality.

### Multi-layer Perceptron (MLP)

The model can be solved as an exponential function. It can be modelled by a neural network.

Using the following network parameters, a [coefficient of determination][2] of 0.953 was obtained on the data.

* Inputs: `TempCondOut`, `PerFreqFanA`, `PerFreqFanB`, `TempAmbient`, `TempWetBulb`
* Output: `TempCondIn`

```
learning rate: 1e-3
hidden_layer_sizes = (20, 20)
activation: ReLU
solver: ADAM
momentum: 0.9
```

[1]: 0-thermo-basics.md
[2]: http://scikit-learn.org/stable/modules/clustering.html#dbscan
 No newline at end of file
[2]: https://en.wikipedia.org/wiki/Coefficient_of_determination
 No newline at end of file
+1.42 KiB (24.8 KiB)
Loading image diff...
−24.2 KiB (97.3 KiB)
Loading image diff...
Loading