---
title: "Behaviour"
output: rmarkdown::html_vignette
date: "`r Sys.Date()`"
vignette: >
   %\VignetteIndexEntry{Behaviour}
   %\VignetteEngine{knitr::rmarkdown}
   %\VignetteEncoding{UTF-8}
bibliography: stormr.bib
---

The `temporalBehaviour()` and the `spatialBehaviour()` functions allow computing wind speed and direction along the lifespan of a tropical cyclone.
The `temporalBehaviour()` function focuses on the temporal variation at a specific location while the `spatialBehaviour()` function focuses on the
spatial variation over a given area. Both functions also allow to compute summary statistics about the behaviour of the wind generated by cyclones.
Three summary statistics are available: maximum sustained wind speed, power dissipation index, and the duration of exposure to winds reaching defined
speed thresholds.

### Maximum sustained wind speed

The maximum sustained wind speed (MSW, in $m.s^{-1}$) over the lifespan of a storm is computed as follows:

$$
\max(v(t) | t \in [0,T])
$$

where
$t$ is the time of the observation<br />
$T$ is the lifespan of the storm<br />

### Power Dissipation Index

The power dissipation index (PDI, in $J.m^{-2}$) or total power dissipated by unit area by a tropical storm over its lifespan [@emanuel_power_1999; @emanuel_increasing_2005] is computed as follows:

$$
\int_T \rho \times C_d \times v_r^3 \ dt
$$

where
$t$ is the time of the observation<br />
$T$ is the lifespan of the storm<br />
$\rho$ is the air density fixed to $1$ $kg.m^{-3}$ as in @emanuel_power_1999 <br />
$C_d$ is the drag coefficient of the storm fixed to $2$ X $10^{-3}$ as in @emanuel_power_1999 <br />

### Duration of exposure

The duration of exposure (in $hours$) to winds reaching defined speed thresholds is computed as follows:

$$
\int_T c(v_t) dt
$$

$$
\left\{
\begin{aligned}
c(v_t) &= 1 \quad if \quad v_t \geq Thd\\
c(v_t) &= 0 \quad if \quad v_t < Thd\\
\end{aligned}
\right.
$$

where<br/>
$t$ is the time of the observation<br/>
$T$ is the lifespan of the storm<br/>
$v_t$ is the maximum sustained wind speed at time $t$ (in $m.s^{-1}$)<br/>
$Thd$ is the minimum wind sped threshold (in $m.s^{-1}$)<br/>

By default the duration of exposure is computed for each Saffir-Simpson Hurricane Scale threshold values for tropical cyclone categories (i.e., $33$, $43$, $50$ ,$58$, and $70$ $m.s^{-1}$, [@simpson_hurricane_2010]) but can be defined using the `wind_threshold` argument.

## References
