Question: 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

 While there exists a closed form mathematical solution to this problem,

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 than 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. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!