Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This problem deals with something known as the mouse or beetle problem. In the problem, n mice start at the corners of a regular n-gon.

This problem deals with something known as the mouse or beetle problem. In the 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. The patterns formed look like the following:

While there exists a closed form mathematical solution to this problem, you must generate a numerical solution. We will restrict ourselves to the five mice problem. 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions