Write a matlab script to generate the coordinates of each

Assignment Help MATLAB Programming
Reference no: EM132081102

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.

Reference no: EM132081102

Questions Cloud

Define what was the net income for the year : The transactions carried out by Coconut Corporation during the year caused an increase in total assets of $50,000 and a decrease in total liabilities of $20,000
Write a program that reads the data from the file produced : Write a c++ program that prompts the user to enter information about course enrollments, and writes this data to file coursedata.txt.
Purchasing modern technology in hospital environment : What challenges occur with purchasing modern technology in a hospital environment?
Examine ethical issues related to the audit function : Write a 750-word essay on the selected topic and examine its importance with respect to ethical behavior. Your essay must cite at least 2 scholarly sources.
Write a matlab script to generate the coordinates of each : Each mouse travels towards its closest neighbor (in a counterclockwise direction) at a constant speed. The paths that the mice take form spiral curves.
Calculating the variance of project completion time : When calculating the variance of a project's completion time,
What is the absolute return to assets : Total assets end of the year - $200.000, Net Farm Income = $23.000, Interest Expense -SI 5.000, and Leverage ratio =1.5. What is the absolute return to assets.
The utilitarianism concept in resolving moral dilemma : What is the advantage and disadvantage of the utilitarianism concept in resolving a moral dilemma?
What is beginning purchase differential created in worksheet : Toni Company is an 80 percent subsidiary of Nathan Industries. At the acquisition date (January 1, 20x5), Toni Company's plant assets (net) had a book.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd