Answered step by step
Verified Expert Solution
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
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 couldStep 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