Question

In: Physics

Examine whether the Verlet and velocity Verlet numerical schemes are time reversible. To show the time...

Examine whether the Verlet and velocity Verlet numerical schemes are time reversible. To show the time reversibility one may use a numerical example i.e. one may iterate the equations 3-4 times with an example you select (hint: start with an initial position and velocity of your choice and iterate the algorithm 3-4 times) or one may show it more rigorously with the manipulation of the Verlet and velocity-Verlet formulae.

Solutions

Expert Solution

struct Body 2 { 3 Vec3d pos { 0.0, 0.0, 0.0 }; 4 Vec3d vel { 2.0, 0.0, 0.0 }; // 2m/s along x-axis 5 Vec3d acc { 0.0, 0.0, 0.0 }; // no acceleration at first 6 double mass = 1.0; // 1kg 7 double drag = 0.1; // rho*C*Area - simplified drag for this example 8 9 /** 10 * Update pos and vel using "Velocity Verlet" integration 11 * @param dt DeltaTime / time step [eg: 0.01] 12 */ 13 void update(double dt) 14 { 15 Vec3d new_pos = pos + vel*dt + acc*(dt*dt*0.5); 16 Vec3d new_acc = apply_forces(); // only needed if acceleration is not constant 17 Vec3d new_vel = vel + (acc+new_acc)*(dt*0.5); 18 pos = new_pos; 19 vel = new_vel; 20 acc = new_acc; 21 } 22 23 Vec3d apply_forces() const 24 { 25 Vec3d grav_acc = Vec3d{0.0, 0.0, -9.81 }; // 9.81m/s^2 down in the Z-axis 26 Vec3d drag_force = 0.5 * drag * (vel * abs(vel)); // D = 0.5 * (rho * C * Area * vel^2) 27 Vec3d drag_acc = drag_force / mass; // a = F/m 28 return grav_acc - drag_acc; 29 } 30 };

Related Solutions

Identify whether the following variables are numerical or categorical. If numerical, state whether the variable is...
Identify whether the following variables are numerical or categorical. If numerical, state whether the variable is discrete or continuous. If categorical, state whether the categories have a natural order (ordinal) or not (nominal). a. Fraction (or percentage) of birds in a large sample infected with avian flu virus b. Number of crimes committed by a randomly sampled individual. c. gender d. Logarithm of body mass e. Stage of fruit ripeness (eg., underripe, ripe, or overripe) f. Tree species g. Petal...
Show the qualitatively correct position versus time graph and the matching velocity versus time graph for...
Show the qualitatively correct position versus time graph and the matching velocity versus time graph for an object that passes through the point X0 = -1 m at t0 = 0 s, and speeds up in the negative X-direction until it reaches a constant speed at tA. Between tA and tB, the object maintains this speed. At tB the object slows down and makes a momentary stop at tC, and immediately resumes the motion in the opposite direction (show a...
a) Explain and give a numerical example of time dilation. b) Explain and give a numerical...
a) Explain and give a numerical example of time dilation. b) Explain and give a numerical example of length contraction.
Numerical MethodsPlease show all steps with clear hand writing. Use numerical methods to Prove that the...
Numerical MethodsPlease show all steps with clear hand writing. Use numerical methods to Prove that the following equations have at leat one solution in the given intervals. (a) x − (ln x)3 = 0, [5, 7] (b) 5x cos(πx) − 2x 2 + 3 = 0, [0, 2]
If dU = CVdT show that for the reversible expansion of one mole of an ideal...
If dU = CVdT show that for the reversible expansion of one mole of an ideal gas: deltaS = CP ln(T2/T1) + R ln(V2/V1) if CV is not equal to f(T).
The university wants to examine whether students spend enough time on their remote classes after switching...
The university wants to examine whether students spend enough time on their remote classes after switching to the online teaching. The university staff sends a survey to 50 random students and asks for the study time per week after the spring break. The mean study time per week of the sample is 25.5 hours. It is believed that the population standard deviation is 3.5 hours. The university wants to know whether the students have spent at least 23 hours per...
For each of the following variables, determine whether the variable is categorical or numerical. If the...
For each of the following variables, determine whether the variable is categorical or numerical. If the variable is numerical, determine whether the variable is discrete or continuous. In addition, determine the measurement scale. a. Number of times the individual changed jobs in the last 5 years b.Fragrance that the individual wears most frequently c. Amount of gasoline used for driving per month d.Day on which the person is most likely to shop online(Monday, Tuesday, etc.)
Chi-square tests are nonparametric tests that examine nominal categories as opposed to numerical values. Consider a...
Chi-square tests are nonparametric tests that examine nominal categories as opposed to numerical values. Consider a situation in which you may want to transform numerical scores into categories. Provide a specific example of a situation in which categories are more informative than the actual values. Suppose we had conducted an ANOVA, with individuals grouped by political affiliation (Republican, Democrat, and Other), and we were interested in how satisfied they were with the current administration. Satisfaction was measured on a scale...
3.For each of the following variables, determine whether the variable is categorical or numerical. If the...
3.For each of the following variables, determine whether the variable is categorical or numerical. If the variable is numerical, determine whether the variable is discrete or continuous. In addition, determine the measurement scale. a. Time comma in hours comma spent surfing the Internet per week b. Whether the individual uses a mobile phone to connect to the Internet c. Number of hamburgers ordered in a week d. Where the individual uses social networks to find sought dash after information e....
For the following described motion, fill in the position/time, a velocity/time, and acceleartion/time graphs on the...
For the following described motion, fill in the position/time, a velocity/time, and acceleartion/time graphs on the grids provided. Show your work for calculating exact positions, velocities and times in the space below. The graphs should be excact. 1. The particle begins at rest at the origin and undergoes an acceleartion of 1m/s for 1s. 2. The acceleration of the particle then changes instantly to zero for 2s. 3. The parrticle then instantly undergoes an acceleration of minus 2m/s for 1s....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT