CS 365 Assignment 4 Report Template Due December 10, 2010 Turn in a hardcopy to my mailbox and email a softcopy

Part 1: Implement the code assigned in part 1 using the following parameters. Show me that your model runs (bring your laptop or your code on a flash drive) by Tuesday, December 2. (50 points).

MMS network parameters: N = 100 xmin = 1 alpha = 2.5 (the exponent is 1-alpha, so the exponent for your distribution is -1.5)

Initial conditions: (the number of initially infected nodes), I_0 = 3 nodes, chosen at random. All remaining (97) nodes are Susceptible. Rate constants for MMS virus spread over the contact network r1 = 0.4 (each infected node infects 40% of it’s contacts at each time step) a1 = 0.3 (each infected node has a 30% chance of recovering each time step)

Rate constants for Blue tooth virus spread through space r2 = 0.5 a2 = 0.2

Space and movement parameters for Bluetooth spread

For 1.3b and 1.3c, proportion of cells that are of the state empty, emptyp = 0.75 For 1.3c, proportion of cells that move at each timestep, movep = 0.2 (move your cells by choosing an empty grid cell to move the node and its state, and replace the old location with the empty state.) Your report should contain the following:

1.1 (10 points) Describe in one paragraph (2-3 sentences) how you created your powerlaw distribution by either providing the equation or describing the algorithm (i.e. if you generated the distribution using preferential attachment) you used. Show 2 histograms: one for the out-degree distribution, and one for the in-degree distribution of each node.

1.2 (10 points) Describe in one paragraph (3-5 sentences) how you have implemented your SIR model for MMS spread over the contact network.

Show the state (S,I or R) of each node over time (similar to Figure 1.2a in the examples)

1.3 (10 points) Describe in one paragraph (5 sentences) how you have implemented your BT SIR model with a) no empty cells, b) emptyp empty cells, c) emptyp empty cells and movep cells that move at each time step. Show 2 screenshots of the spatial grid at time t= 20 and at t = 100 (6 grids total that look like the three panels in example Figure 1.3)

1.4 (10 points) Use your code from sections 1.2 and 1.3c to simulate the spread of a hybrid virus that can spread via the MMS contact list or via Bluetooth for individuals who move through a grid (with emptyp and movep specified for 1.3c). Describe how you implemented this. Show screenshots of your grid at times t = 1, 5, 10, 20, 40, and 100.

Part 2: Analyze your models 2.1 (10 points) Show the percentage of nodes that have been infected (those that are either infected or recovered) for one run of each model above (1.2, 1.3a, 1.3b, 1.3c, and 1.4), all on one figure as in example figure 1.4.

2.2 (15 points) Run each model 10 times, and for each run, record the first time at which 50% of the nodes are infected. Provide a bar graph that shows the mean number of iterations for each of the 4 models, with errorbars that show the standard deviation. (In Matlab you can use the functions bar and errorbar, and use the hold on and hold off functions to overlay them). Provide a paragraph explaining what these results show. 2.3 (5 points) Calculate and report R0 for each model, and explain how R0 relates to your results in 2.1 and 2.2.

2.4 (15 points) Parameter Sweep. For model 1.2, vary r1 and a1 from 0 to 1, in increments of 0.1. Plot the number of infections at t = 100 as a function of all 121 combinations of r1 and a1 (in Matlab use plot3 to plot the number of infections as a function of the two variables r1 and a1. You may plot each infection as a point.) Do the same for model 1.3c, but present 3 separate plots, one for each of these value of movep: 0, 0.1, 0.2.

Provide a paragraph explaining what these results show. Explain conditions under which Bluetooth or MMS viruses spread further and faster.

2.5 (10 points) Summary. Provide 2 paragraphs summarizing your results. Document who you worked with, and what each person contributed, and any code that you downloaded.

Extra credit: Propose in a short paragraph how you will extend the models or analysis for up to 30 extra credit points. Provide the proposal when you show me your code on or before December 2.