# Homework 5, due 08.00, 15/10-2015¶

## Angry Birds: Numerical Solution of ODE¶

This homework is concerned with a problem of immense societal importance; the simulation of angry birds.

Let the location of bird number \(k\) be \(B_k(t) = (x_k(t),y_k(t))\), obviously the bird leader is \(B_1(t)\).

The bird leader does not really care too much about the other birds but is primarily interested in eating birdy nam nam being handed out by the crazy bird feeder at \(C(t) = (x_c(t),y_c(t))\). At any given point in time \(B_1(t)\) is thus trying to reduce its distance to \(C(t)\) by

where \(\gamma_1\) is a positive constant that depends on how good the food tastes.

Simulate this equation for some randomly chosen initial locations for the bird leader using the classic fourth order Runge-Kutta method. Explain in words what the meaning of the equation is describing, for example what does it mean when \(x_c > x_1\)? Try with some different examples of \(C(t)\) including \(C(t) = (0,0)\) and \(C(t) = (\sin(a t),\cos(a t))\).

The rest of the birds are trying to stay close to the leader and are therefore governed by

where \(\gamma_2\) depends on how charismatic the bird leader is.

There is another mechanism that is important to the birds and that is to be as close as possible to the middle of the flock or birds. This will be safer if the flock is attacked by a predator that will try to single out a lonely bird to catch. Let the center of gravity be denoted \(\bar{B}\) then to each right hand side you can add

Of course if the birds get too close to each other they cannot maneuver properly so there is also a strong repelling force. If bird number \(k\) is repelled by its \(L\) closest neighbors we can add to the right hand sides

For this assignment the main objective is to experiment with the mathematical model. The possibilities are endless:

- Experiment with different parameters and different number of birds. Can you explain how the different parameters impact the behaviour of the flock?
- How does the diameter (what is a reasonable definition?) change over time and for different scenarios?
- How does the dynamic change if you have shared leadership?
- Add a smelly bird that want to be at the center but is strongly repellant to the other birds.
- How does the numerical method impact the results? Try Forward Euler. Try different time steps.
- Can you add a predator that eats the birds but gets slower as it gets fatter and fatter?
- Can you model something else? A social network, a soccer game, spread of diseases between individuals based on their travel patterens, and so on...
- Your own extensions...

Write up a nice report with your findings. Add some movies of Angry birds to your repository.