Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this in Python code Finite Differences The Dynamic Loop can be used to compute the motion of a system of particles: 1. Compute

image text in transcribed

image text in transcribed

I need this in Python code

Finite Differences The "Dynamic Loop" can be used to compute the motion of a system of particles: 1. Compute the forces. 2. Update the velocities. 3. Update the positions. 4. Go to 1. There are more efficient ways to do the numerical integration, but for simplicity, we will start with first-order finite differences. In essence, we make the approximation df fn+1 - for dt At and use this to determine the next value of f from the current value and the derivative: df fn+1 fn + At dt df This method assumes that the derivative can be calculated. dt Constant Acceleration Let's apply this method to a system whose solution is known: one-dimensional motion under constant acceleration. The equations of motion are a dr d v(t) dt dt Let the constant) acceleration be the acceleration due to gravity and use the following values for the initial position and velocity. (You can experiment with other values later.) a= -9.8 m/s2 20 = 0.0 m Vo = 98 m/s Write Python code to simulate the motion of the projectile for 20 seconds. Create plots of (t) to compare the exact solution with the result of the finite difference method for the following values of the time step: At=1.0 s At=0.1 s At=0.01 s At=0.001 s Explore other values of At if you would like. Is there a point beyond which you would say the finite difference method has "converged" to the exact solution

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

Students also viewed these Databases questions

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

5. What information would the team members need?

Answered: 1 week ago