Each mouse travels towards its closest neighbor in a


You need matlab help, please help me with this problem.

This assignment deals with a problem known as the mouse or beetle problem.

In the general problem, n mice start at the corners of a regular n-gon.

Each mouse travels towards its closest neighbor (in a counterclockwise direction) at a constant speed. The paths that the mice take form spiral curves.

An animation of the pattern can be seen on the above web site. While there exists a closed form mathematical solution to this problem, this assignment requires you to generate a numerical solution.

We will restrict ourselves to the five mice problem. You are to write a Matlab script to generate the coordinates of each of the five mice as they move towards each other. You will then graph the paths the mice take.

Start by initializing the positions of the 5 mice. The positions should be symmetric and they should all lie on the unit circle centered at the origin.

There is no input for the program. You could use two vectors of size 5 to represent the x- and y- coordinates of the mice.

On each iteration

Each mouse should move a distance d towards its neighboring mouse. That is, towards the closest mouse in a counterclockwise direction.

(Hint: To find the neighbor of mouse x, you just have to add 1 to x modulo 5 i.e. compute (x+1)%5)

Generate the new coordinates of each mouse.

In order the graph the function, you could store the sequence of vectors in matrices, with each line representing the coordinates at one of the time steps.

The iterations should be repeated until the mice are sufficiently close to each other. You should NOT hardcode the number of times the loop is repeated but you must determine how to test that they are close. You can use a value of 0.01 for d, the distance each mouse moves at each time step.

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: Each mouse travels towards its closest neighbor in a
Reference No:- TGS02874562

Expected delivery within 24 Hours