Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

And these are the functions I have to work with in order to create the new function.

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago