Question: Consider a system of particles in motion ( for example, a pressurized container of gas, where the gas molecules could be thought of as particles
Consider a system of particles in motion for example, a pressurized container of gas, where the gas molecules
could be thought of as particles Suppose the system has particles, each with mass and velocity
for dots, at some particular moment in time. The total momentum of this
system can be computed as
and the total kinetic energy of the system could be computed as
where denotes the magnitude vector norm of the velocity of particle
Write a function calcmomenergy that computes and returns the total momentum and kinetic energy
of the system. The input is a D numpy array of size that contains a list of particle masses, and the input
is a D numpy array, where each row contains the velocity components of particle
Additionally, your code should perform basic error checking on the validity of the inputs by returning
for momentum and for the kinetic energy if either of the following is true:
The length of and the number of rows in are not equal
does not have columns
In your code below, the following function will be graded by checking several sets of input arguments:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
