You are Here: Home >< Maths

# Matlab watch

1. I have to construct a computer program on Matlab to simulate the spread of disease in an orchard. The trees are arranged in a rectangular array. If one tree becomes infected, the disease can spread to its neighbours, such that at the next time t+tau, the neighbouring tree in the same row will be infected with a proability r, and a neighbouring tree in an adjacent row with probability s. Trees may recover with probability q.
2. (Original post by rrosed)
I have to construct a computer program on Matlab to simulate the spread of disease in an orchard. The trees are arranged in a rectangular array. If one tree becomes infected, the disease can spread to its neighbours, such that at the next time t+tau, the neighbouring tree in the same row will be infected with a proability r, and a neighbouring tree in an adjacent row with probability s. Trees may recover with probability q.

Are you asking about a particular point of Matlab programming or do you need help with the algorithm? If it's the latter, then the strategy of, at every "tick" of the clock:

(a) keep a list of infected trees.
(b) calculate a list of trees "at risk" from the infected trees.
(c) Simulate to determine which trees in (b) actually become infected.
(d) Simulate to determine which trees in (a) become un-infected.

But notice two problems: you haven't specified any relative order for (c) and (d) and also you haven't specified what the infection probability is for a tree that is "at risk" from two adjacent (row adjacent and column adjacent) trees.
3. This is all the information I've been given, so I think it's open for interpretation. I have never done anything like this before, or been given much guidance, but if you would have any advice on how to start the actual coding for a program like this, that would be very useful. Or anywhere that I can do some research to get some help, as I can't find much. Thank you for your time
4. (Original post by rrosed)
This is all the information I've been given, so I think it's open for interpretation. I have never done anything like this before, or been given much guidance, but if you would have any advice on how to start the actual coding for a program like this, that would be very useful. Or anywhere that I can do some research to get some help, as I can't find much. Thank you for your time
Are you doing this as part of an educational course? If so, surely you've done some sessions on "Introduction to Matlab" or "Introduction to programming" - goodness, if not, there are plenty of guides online (including the Matlab documentation, which is very good).

My advice on starting the coding is as I've given in the previous reply. Sorry to be blunt, but you'll need to learn enough programming to understand my hint before you can really make progress.

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: February 13, 2018
Today on TSR

How do you think you'll do?

### University open days

Wed, 25 Jul '18
2. University of Buckingham
Wed, 25 Jul '18
3. Bournemouth University
Wed, 1 Aug '18
Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams