Python implementation of the population dynamics proposed in the paper: "Disruption of Vector Host Preference with Plant Volatiles May Reduce Spread of Insect-Transmitted Plant Pathogens".
I noticed there is an error in the original paper in equation 2. The correct equation should be:
Follow the steps below to set up the environment and run the model to replicate the figures from the paper.
-
Clone the repository:
git clone https://github.com/gianluccacolangelo/Disruption-of-Vector-Host-Preference cd Disruption-of-Vector-Host-Preference
-
Install dependencies using Conda:
Make sure you have Conda installed. If not, you can install Miniconda.
conda env create -f conda_environment.yml
-
Activate the environment:
conda activate Disruption-of-Vector-Host-Preference
After setting up the environment, you can start using the model to simulate the population dynamics.
-
Open a Python session:
python
-
Import and use the
PsyllidModel
class:from model import PsyllidModel # Create an instance of the model with default parameters model = PsyllidModel() # Solve the model model.solve() # Plot the results model.plot()
You can change the parameters to see how different conditions affect the population dynamics. For example:
# Modify critical parameters
model = PsyllidModel(c=0.5, lambdu=0.06, gamma=17e-8, g=56, beta=0.04, initial_conditions=[0, 1, 0, 0, 13000, 0])
# Solve and plot the modified model
model.solve()
model.plot()
Here is an example of how to create, solve, and plot the model:
from model import PsyllidModel
# Initialize the model with specific parameters
model = PsyllidModel(c=0.75,mua=7.6,lambdu=0.06, gamma=17e-8, g=56, beta=0.04, initial_conditions=[0, 1, 0, 0, 13000, 0])
# Solve the model
model.solve()
# Plot the results
model.plot()
The environment is defined in the conda_environment.yml
file, which includes all necessary dependencies:
name: Disruption-of-Vector-Host-Preference
channels:
- defaults
dependencies:
- python=3.8
- matplotlib
- numpy
- scipy
Contributions are welcome! Please feel free to submit a pull request or open an issue.