Answered step by step
Verified Expert Solution
Question
1 Approved Answer
And these are the functions I have to work with in order to create the new function. 131 (2O%) Write a function called calculateTrajectories whose
And these are the functions I have to work with in order to create the new function.
131 (2O%) Write a function called calculateTrajectories whose purpose is to evolve particle initial positions and initial velocities in time. It should start from initial positions and velocities, take a step forward in time, calculate new positions and velocities, store these new values in arrays, and then repeat that process over and over again. Inside this loop, your function should call the updateParticles function whenever you want to advance the positions and velocities by a time step. The following describes one possible way that your calculateTrajectories function could work. Here, nParticles is the number of particles, nDimensiona-3 is the number of spatial di- mensions (x, y, z), and nTines is the number of different time points where you calculate positions and velocities. The inputs to this function should be: - masses (1D array, with nParticles elements) - initial positions (2D array, nParticles x nDimensions elements) -initial velocities (2D array, nParticles nDimensions elements) 131 (2O%) Write a function called calculateTrajectories whose purpose is to evolve particle initial positions and initial velocities in time. It should start from initial positions and velocities, take a step forward in time, calculate new positions and velocities, store these new values in arrays, and then repeat that process over and over again. Inside this loop, your function should call the updateParticles function whenever you want to advance the positions and velocities by a time step. The following describes one possible way that your calculateTrajectories function could work. Here, nParticles is the number of particles, nDimensiona-3 is the number of spatial di- mensions (x, y, z), and nTines is the number of different time points where you calculate positions and velocities. The inputs to this function should be: - masses (1D array, with nParticles elements) - initial positions (2D array, nParticles x nDimensions elements) -initial velocities (2D array, nParticles nDimensions elements)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started