# RCN Marine Disease Modeling and Transmission Workshop

### May 11-15, 2015

### Center for Coastal Physical Oceanography

Old Dominion University

Norfolk, Virginia 23529

## Workshop Resources

### An Introduction to MATLAB at this link

### MATLAB code for the various models

Each of the models described below is programmed in four matlab scripts. Matlab scripts are required to end with .m.

The main (driver) script sets up the model (defines parameter values, sets initial conditions and run length) and then runs the model for the specified time. The main script also renames the solution to have more convenient names (S, I, D, P).

The structure of the model is specified in the script starting with RHS which defines the right-hand-side of the time dependent ODEs defining the model. These control the interaction of the various parts of the model.

The value of the various parameters of the model are specified in the script with names starting with PAR. The variable names are chosen to be descriptive. All parameters are part of a matlab structure (called PAR) as an easy way to pass all of the values around.

The final script, starting with PLOT, makes plots of the model solution. These are mainly the number of animals in various model categories over time. Some graphs show the rate of some model processes. It should be easy to add other figures.

### MATLAB commands to run a model

MATLAB needs to be installed on the computer you are using. Download the model scripts (below) and put them in a folder on your computer. Start MATLAB. The large window in the middle of the page that opened is (most likely) the command window. MATLAB acts on commands typed into this window. The MATLAB prompts are ">> ".

Make sure that the current active directory is the folder in which you put the matlab scripts. The line just above the command window tells you what folder is the current folder MATLAB is working in.

At the MATLAB prompt in the command window, type
`abalone1` to run the first model. This will set the
parameters and run the model.

To plot the model solution, type `PLOTabalone1`. One or more
figures will appear on the screen.

MATLAB has an editor which is available with the "open" button on the upper left of the MATLAB page. Use this editor to change parameter values, graphics or model interactions.

Any editor can be used to change the MATLAB scripts, the built-in one has convenient features. The only requirement is that the files must be plain text (no word processors).

### Details of the models

- All models programmed in R (thanks to Emil Aalto). These require r packages deSolve, ggplot2, grid, and reshape2. (abaloneODE.r)
- Single species, single population model (model 1)
- Overview of the model (pdf document)
- Example solution for the model.
- Matlab Scripts:
- Main routine (abalone1.m).
- Model interactions (ODE RHS) (RHSabalone1.m).
- Parameter specification (PARabalone1.m).
- Plot Routine (PLOTabalone1.m).
- Model through a graphics interface (Abalone1.m) with the GUI (Abalone1.fig).
- Model 1 programmed in R (thanks to Bhagat Lal Dutta) (abalone1.R)

- Single species with recruitment (model 2)
- Overview of the model (pdf document)
- Example solution for the model.
- Matlab Scripts:
- Main routine (abalone2.m).
- Model interactions (ODE RHS) (RHSabalone2.m).
- Parameter specification (PARabalone2.m).
- Plot Routine (PLOTabalone2.m).
- Model through a graphics interface (Abalone2.m) with the GUI (Abalone2.fig).

- Single species, multiple sub-population model (model 3a)
- Overview of the model (pdf document)
- Example solution for the model.
- Matlab Scripts:
- Main routine (abalone3a.m).
- Model interactions (ODE RHS) (RHSabalone3a.m).
- Parameter specification (PARabalone3a.m).
- Plot Routine (PLOTabalone3a.m).

- Single species, multiple sub-population model (model 3c,
modified from model 3a)
- Matlab Scripts:
- Main routine (abalone3c.m).
- Model interactions (ODE RHS) (RHSabalone3c.m).
- Parameter specification (PARabalone3c.m).
- Plot Routine (PLOTabalone3c.m).

- Matlab Scripts:
- Multiple species, single population model (model 3b)
- Overview of the model (pdf document)
- Example solution for the model.
- Matlab Scripts:
- Main routine (abalone3b.m).
- Model interactions (ODE RHS) (RHSabalone3b.m).
- Parameter specification (PARabalone3b.m).
- Plot Routine (PLOTabalone3b.m).

- Multiple species, multiple sub-population model (model 4)
- Overview of the model (pdf document)
- Example solution for the model.
- Matlab Scripts:
- Main routine (abalone4.m).
- Model interactions (ODE RHS) (RHSabalone4.m).
- Parameter specification (PARabalone4.m).
- Plot Routine (PLOTabalone4.m).

- Multiple species, single population model (allometric parameters)
- Matlab Scripts:
- Main routine (allometric.m).
- Model interactions (ODE RHS) (allometricRHS.m).
- Parameter specification (allometricPAR.m).
- Plot Routine (allometricPLOT.m).
- Parameter Plots (allometricParam.m).

- Matlab Scripts:
- Multiple species, single population model (SIP model with restoration)
- Matlab Scripts:
- Main routine (runSIP.m).
- Model interactions (ODE RHS) (SIP.m).
- Parameter specification (paramsSIP.m).

- Matlab Scripts: