Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

programming language is python, jupyter notebook. I already have functions called; forceMagnitude(mi, mj, sep);;two masses, seperation. gives me force magnitude magnitude(vec); Gives me the magnitued

image text in transcribed

image text in transcribed

programming language is python, jupyter notebook. I already have functions called;

forceMagnitude(mi, mj, sep);;two masses, seperation. gives me force magnitude
magnitude(vec); Gives me the magnitued of a vector
unitDirectionVector(pos_a, pos_b);Gives me a unit vector in the given direction
forceVector(mi, mj, pos_i, pos_j);
 Computes the gravitational force vector exerted on particle i by particle j

calculateForceVectors(masses, positions); Calculates the force vectors with any amount of masses and positions.

Test this function to make sure you understand what it is doing. 13 l (20%) Write a function called calcul ateTrajectories whose purpose is to evolve particle initial positions and initial velocities in time. It should start from initial positions and velocities, 2 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. ing descrihes one nossible way that your calculateTrajectories function could Test this function to make sure you understand what it is doing. 13 l (20%) Write a function called calcul ateTrajectories whose purpose is to evolve particle initial positions and initial velocities in time. It should start from initial positions and velocities, 2 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. ing descrihes one nossible way that your calculateTrajectories function could

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago