# VSG Group 2: Foliar Plant Spray
[Google Drive](https://drive.google.com/drive/folders/1DQ88iyzUn8RObPO0yYFZiFig6i1X9WYR)
-----
## Group Members
* Anke Buchholz (anke.buchholz@syngenta.com) available on Tue; Wed & Thu for morning and closure sessions
* Chris (the older) Budd mascjb@bath.ac.uk Tues am, maybe later in the pm, Weds am, some of PM, not Thursday
* Chris (the younger) breward@maths.ox.ac.uk. Aim to be around most times, modulo finishing finals Qs. But will be jumping between teams
* Sam Kamperis (s.kamperis@brookes.ac.uk) available Tues, Weds AM and Thurs
* Martin Knight (martin.knight@bioss.ac.uk) available Tues, Weds until 14:00, and Thurs AM
* Marcus Tindall (m.tindall@reading.ac.uk) available in amongst other committments Tues, Wed & Thurs.
* Inzish Sajid (i.sajid@pgr.reading.ac.uk) available Tuesday, Wednesday, Thursday PM
* Kayode Oshinubi, kayode-isaac.oshinubi@nau.edu. Due to my time zone, I may be on and off atimes
* Edgardo Villar-Sepúlveda, edgardo.villar-sepulveda@bristol.ac.uk, Available Wednesday and Thursday
------
Caterpillarity modelling:
Qs I'd like to get a take on.
(a) how does pesticide act? Is it that the caterpillar needs to have a certain # mg of the substance in it's body?
ANS: Not well known, but this is in line with their hypothesis
(b) do the caterpillars have to take onboard the pesticide while it is in wet form, or is it also taking stuff in when it's dried on a leaf?
ANS: Liquid quickly evaporates leaving behind insecticide.
(c) how often is the pesticide sprayed? and what is it's half
ANS: weekly intervals. (1 week later - spray new leaves). Stable on this timescale. Lifetime of caterpillar ~2 days. Want pesticide to kill caterpillar in 10 hrs. 1 sq mm per hour feeding rate
COMMENTS: Caterpillars eat an area. Then poo. Then move to another area and eat. In experiments, 1 caterpillar per leaf. Caterpillars try to separate well.
COMMENTS: Could we make a model with generic parameters for them to test out how caterpillar behaves.
COMMENTS: Stuff through the feet can be really important. It can be much faster than ingestion.
(d) What's the contact angle for the liquid?
ANS: lower than water. Sometimes have super spreader molecules (sometime ST very low). They get coffee-ring effect.
**Chris Budd**: Wants to know small scale and then links up to the large scale I would want to know
* How the spray averages out over the leaves sprayed (space and time)
* How the caterpillar uptake averages out over the leaves (space and time)
* How this impacts on the life cycle of the caterpillar
* How the leaves sprayed depend on the field geometry and the spraying schedule
* How does the probability a caterpillar dies depend on (i) the level of the dose on the leaf - may be there is a phase transition with a rapid change in probability depending on the droplet concentration (ii) time on the leaf
There is a nice contrast here between a continuum model which loos at an average density of insectivide per leaf, and a discrete approach which looks at the nunber of droplets per leaf. (The second could be tackled using techniques from geometric probability theory)
----

----
**Caterpillar gut/surface absorption model**
Consider Figure 1 which shows a simple compartmental model of pesticide absorption via the gut and feet surface pathways. Ideally we wish to maximise the concentration of the pesticide in the tissue in order to kill the caterpillar. We thus need to consider which is the most effective route, either via ingestion or surface contact, which leads to the highest concentration in the tissue in the shortest amount of time. The concentration of the pesticide in the gut $G(t)$ [$\mu$g AI/ mg wwt] (DOUBLE CHECK THIS DEFINITION), blood $B(t)$ [$\mu$g AI/ mg wwt] (DOUBLE CHECK THIS DEFINITION), and tissue $T(t)$ [$\mu$g AI/ mg wwt] (DOUBLE CHECK THIS DEFINITION) is described by
\begin{eqnarray}
\frac{dG}{dt} & = & \alpha(t) - (k_1 + k_2)G, \\
\frac{dB}{dt} & = & k_1 V_{GB} G - k_3 B + \lambda \cdot \begin{cases}
\phi(t) - B, \text{ if } \phi(t) \geq B,
\\[2ex]
0, \text{ if } \phi(t) < B,
\end{cases} \\
\frac{dT}{dt} & = & k_2 V_{GT} G + k_3 V_{BT} B-\beta T,
\end{eqnarray}
with the initial conditions
$$
G(0) = 0 \quad B(0)=0 \quad \mbox{and} \quad T(0)=0,
$$
where $V_{GB}$ is the gut to blood compartmental volume ratio, $V_{GT}$ is the gut to tissue and $V_{BT}$ is the blood to tissue and $\beta$ is the elimination rate constant. We also observe that the eating rate $\alpha(t)$, and the rate of adsorption through the feet, $\lambda (\phi(t) - B)$, are scaled with respect to the volumes of the gut and blood, respectively. For simplicity we set the volume ratios to unity to begin with.

Figure 1
{Note:I try to define the values of $\alpha(t)$ and $\phi(t)$ in terms of the given data/information (Presentation Slides, Page 17). Please check for the errors!!!!!}
$$\alpha(t)=\frac{\text{Leaf consumption} \times \text{Active Ingredient}\times e^{-\delta t}\times (t- \lfloor t \rfloor)}{\text{Spray Volume}}$$
$$\phi(t)=\left( \frac{\text{Leaf consumption}\times e^{-\delta t}}{\text{Size of one bite}} + \frac{\text{Path}}{\text{Larva Length}} \right)$$
$$\times \left( \frac{\text{Total area abdominal prolegs} \times \text{Active Ingredient} \times (t- \lfloor t \rfloor)}{\text{Spray Volume}} \right)$$
where $\delta$ is the decay parameter which can be optimized by fitting the larval movement and toxicity data(Presentation Slides: Page 18). The first term of $\phi(t)$ includes the absorption when the caterpillar is feeding or resting, however the second term includes the absorption when the caterpillar is moving. By changing the values of Active Ingredient and Spray Volume we can predict the toxicity and hence find the optimized values for AI and spray volume. We can replace $e^{-\delta t}$ with some other functions by considering the behaviour of the leave damage. In case of the conversion of the units we include the factor $10^r$ in the terms , where r is to be determined.


----

Figure 2
Units:
$\alpha(t)$: [$\mu$g AI/ h mg wwt]
$k_1$, $k_2$, $k_3$: [1/h]
$\lambda$: [1/h]
$\beta$: [1/h]
Parameter estimation:
Simplest case first - constant coverage of AI on leaf (i.e. not discrete spots), and the caterpillar continously moves (i.e. does not stop).
For $\alpha$, we take two things into account: 1.25 [g AI/ha] (application rate) and 13.7 [mm^2/h] (leaf consumption).
Therefore,
$\alpha = 1.25 \left[\frac{g AI}{ha}\right] \cdot 10^6\left[\frac{\mu g AI}{g AI}\right] \cdot 10^{- 10} \left[\frac{ha}{mm^2}\right] \cdot 13.7 \left[\frac{mm^2}{h}\right] = 0.0017125\left[\frac{\mu g AI}{h}\right].$
First of all, we start with $\beta = 0$
Kayode is thinking of perhaps we use a metapopulation model of the kind below
\begin{align*}
\frac{dG_i}{dt} & = \alpha_i(t) - (k_1 + k_2)G_i - \sum_{j=1}^N M_{ji}G_i + \sum_{j=1}^N M_{ij}G_j, \\
\frac{dB_i}{dt} & = k_1 V_{GB} G_i - k_3 B_i + \lambda_i(\phi_i(t) - B_i) - \sum_{j=1}^N M_{ji}B_i + \sum_{j=1}^N M_{ij}B_j, \\
\frac{dT_i}{dt} & = k_2 V_{GT} G_i + k_3 V_{BT} B_i - \beta_i T_i - \sum_{j=1}^N M_{ji}T_i + \sum_{j=1}^N M_{ij}T_j,
\end{align*}
where $M_{ji}$ is migration rate from patch $j$ to $i$ which will still follow the simulation rules.
## ABM
Single leaf, single caterpillar. Leaf divided into $x$ evenly sized grid squares. Initial distribution of droplets assumed to be Uniform? Number and concentration of droplets and their impact of caterpillar survival are scenarios we want to model. Caterpillar starts in random patch of leaf and consumes leaf matter at constant rate. Ingestion of pesticide occurs with rate proportional to consumption rate and the pesticide quantity. As caterpillar moves across patches, pesticide absorbed through movement at rate proportional to intrinsic absortion index and pesticide quantity on patch. Pesticide accumulates in caterpillar, and when levels reach threshold value, caterpillar dies. Defecation occurs at rate proportional to consumption in previous timestep.
Thoughts on simulation framework: Stochastic Gillespie Algorithm?
Basic idea behind simulation framework:
* All possible events have an event rate $E_i(t)$. The total event rate is the sum of all possible events, $E(t)$.
* At the beginning of each time step, the next event rate is $N(t) =E(t)*U(0,1)$, where $U(0,1)$ is a uniform random number.
* We then loop through each event and accumulate a partial rate $P(t)$ until $E_{i-1}(t) < P(t) \leq E_i(t)$, and then event $i$ occurs.
* Event rates are recalculated and the process repeats until some criteria met.
#### Simulation rules
At every timestep of the simulation, the caterpillar can either stay where it is, or move to one of its neighbouring patches.
Its propensity to move to a specific patch is dependent on the quantity of food in that patch (denoted by colour of grid square in sim?), negatively weighted by the number of fecal pellets on that patch.
$$M_i(t) = c*Q_{l,i}(t)/N_{f,i}(t),$$
where $M_i(t)$ is the movement rate to patch $i$ (implicit assumption is that caterpillar can move to patch $i$), $Q_{l,i}(t)$ is the quantity of food on patch $i$ at time $t$, $N_{f,i}(t)$ is the number of fecal pellets on patch $i$ at time $t$, and $c$ is a constant.
On the caterpillar's patch it will consume $E(t)=a*Q_{l,i}(t)$ leaf matter, where $a$ is the intrinsic consumption rate.
At the beginning of each time step, the caterpillar will excrete $b*E(t-1)$ onto its current patch before it moves on (or stays on current patch).
Toy [netlogo](https://www.netlogoweb.org/launch#NewModel) code
**Current model implementation**
* Code below generates leaf patches, green being free of pesticide, and pink containing pesticide. At the moment there's a fixed number of pink patches randomly distributed and have a fixed pesticide quantity (default value of 1).
* Single caterpillar spawns on random patch and on each tick of the simulation will move to one of its neighbouring patches and consumes the food on that patch. For simplicity, at the moment if there are no patches surrounding it that it can eat from, then it will face the direction of a green patch and move one patch in that direction. We also assume that the caterpillar can move through empty spaces...potentially fine for petri dish model but would need refinement for more realistic field models.
* Consumption increases its satiation by 1, and once the caterpillar reaches a satiation threshold, then it stops eating. It continues moving at each tick, and at each tick its satiation will drop. Once the caterpillar's satiation reaches 0, it can begin eating again.
* If the caterpillar consumes a patch with pesticide on it, then it ingests the pesticide. Once the pesticide levels in the caterpillar reaches a critical value, it dies and the simulation stops.
What still needs done:
* Absorption of pesticide through movement.
* Defecation and preferential movement towards patches that are "clean".
* Choosing suitable parameter values for absorption rate and ingestion rate, satiation thresholds, and critical pesticide levels before death.
* Droplet dynamics. Incorpotation of concentration of drops and size (in terms of num. patches in an area that represent a single droplet).
* General improvement of visual environment scales (want each patch in the model to represent a single potential bite for the caterpillar).

```
breed [ caterpillars caterpillar ]
patches-own [ food_quantity pesticide_quantity ]
caterpillars-own [ pesticide_level satiated satiation ]
globals [ consumption_rate defecation_rate absorption_rate satiation_threshold pesticide_threshold]
to setup
clear-all
set consumption_rate 1
set defecation_rate 1
set absorption_rate 1
set satiation_threshold 10
set pesticide_threshold 50
ask patches [
set pcolor green
set food_quantity 1
set pesticide_quantity 0
]
create-caterpillars 1 [
set color red
set shape "bug"
set pesticide_level 0
set satiated 0
set satiation 0
move-to one-of patches
]
let brown_patches 0
let max_brown_patches 10
while [ brown_patches < max_brown_patches ][
ask one-of patches [
if pcolor != pink [
set pcolor pink
set brown_patches brown_patches + 1
set pesticide_quantity 1
]
]
]
reset-ticks
end
to go
let quantity_eaten 0
let pesticide_eaten 0
let pesticide_absorbed 0
ask caterpillars [
ifelse (all? neighbors [pcolor = black])[
set heading towards one-of patches with [pcolor != black]
forward 1
][
move-to one-of neighbors
]
if satiated = 1 [
set satiation satiation - 0.2
if satiation < 0 [
set satiation 0
]
if satiation = 0.0 [
set satiated 0
]
]
ask patch-here [
if [satiated] of myself = 0 and [satiation] of myself < satiation_threshold [
set quantity_eaten min(list food_quantity 1)
set pesticide_eaten 0
set food_quantity food_quantity - quantity_eaten
if food_quantity = 0 [set pcolor black]
ifelse pesticide_quantity >= 0 [
set pesticide_eaten quantity_eaten
set pesticide_quantity pesticide_quantity - pesticide_eaten
][
]
ask myself[
set satiation satiation + quantity_eaten
set pesticide_level pesticide_level + quantity_eaten
]
if [satiated] of myself = 0 and [satiation] of myself = satiation_threshold [
ask myself [
set satiated 1
]
]
]
]
]
if (all? caterpillars [pesticide_level = pesticide_threshold]) [stop]
tick
end
```
1.6 (±0.3) faeces per hour
leaf disks (Ø 36 mm)
exsmple shown on slide 18: 5 g AI/ha (AI = active ingredient)
sprayed at 100 l/ha
**Settings for netlogo plots**


-----
**Chris Budd comments**
We need to combine the ABM and the dose models.
* The ABM tells us what the caterpillar is doing, and the dose model then tells us how much insecticide they absorb.
* Have a think about the various parameters in the model such as the overall dose level of the insecticide on the leaf. From these see if you can infer how many caterpillars will be killed as a consequence of these parameters
* See if you can then reporoduce the slide below inwhich we saw of the number of dead caterpillars as a function of the two dosage parameters.
* From this leaf level calculation, see if you can scale up to a field level calculation
-----
