Question: Can someone help me with this Matlab code? Thank you. 2. The center of mass of a collections of N particles is given by: N

Can someone help me with this Matlab code? Thank you.

Can someone help me with this Matlab code? Thank you. 2. The

2. The center of mass of a collections of N particles is given by: N 1 rcm = miri, M i=1 where M = 8:21 Mi is the total mass of the particles being considered, and r; is the position of the ith particle. a) Write a m-file that computes the center of mass of a collection of particles, test it for the next case: N = 5, r : (2, 2.1), r2 = (-1, 1.2), r3 = (0, -0.5), r4 = (1,0.8) and r5 = (1.3, 1.7). Consider all masses being the same and equal to 1. The code should also plot particle positions. b) Write a Matlab function that generates the positions of N particles at random, in the area [-2, 2] * [-1,1] (use the built-in function rand). c) By using N = 1000, compute the center of mass of all particles in b), that are located at [0, 1] [0, 1]. Plot the particle positions

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!