Question: DONE IN PYTHON 3.6 PLEASE The equation of motion for a pendulum is dt2l a) Write an Euler-Cromer evolution code to calculate the angle ?
DONE IN PYTHON 3.6 PLEASE

The equation of motion for a pendulum is dt2l a) Write an Euler-Cromer evolution code to calculate the angle ? and angular velocity of the pendulum at time t, given initial values ?? and uo. The total energy of the system is the kinetic energy plus gravitational potential energy Write down an expression for the energy as a function of ?, w, g, l and m. Add the energy calculation to your code. Use a time step in your code that keeps thel energy constant to better than 1% accuracy b) Often, the pendulum is approximated as a simple harmonic oscillator. To do this we assume the angle is small, so that sin ? and cos. 1-972 Add to your existing program the code to evolve the pendulum using the small angle formula. c) Take the mass of the pendulum to be m=15kg with length 1-2.4m, use g=9.8m/s' Take the initial angle initial angle of ??-?/3 radians and zero initial angular velocity, uwo-0. Evolve the system for 10 seconds, using both the pendulum and simple harmonic oscillator codes. Generate a figure with three subplots, the top showing angle ? vs time, the second angular velocity against time and the third energy vs time. d) Calculate the first time that the angular velocity is greater than zero, for both pendulum and harmonic oscillator. What fraction of a period does this time corresponds to? What is then the estimated period for the pendulum and the simple harmonic oscillator? How many oscillations before the approximation is wrong by 1 whole cycle? Damping and driving We can add a damping term to the harmonic oscillator (a force that acts proportional to and opposite to the angular velocity). Also, we can add a driving term that pushes the pendulum with a maximum torque of A at an angular frequency wp. In this case, the equation of motion of the oscillator is C d A dt2 l m dt m e) Implement both the damping and driving terms in your code (there's no need to keep the harmonic oscillator approximation) f) Two children of mass m-15kg sit on swings with l-2.4m and C/m -0.1s1. One is pulled to ?,-?/4 rad and released from rest. The other starts with ?,-0, ?,- 0 and is pushed with A/m = 0.1 s= aa-2 rad/s. Plot the motion of the two children (both position and velocity) for 60 seconds. The equation of motion for a pendulum is dt2l a) Write an Euler-Cromer evolution code to calculate the angle ? and angular velocity of the pendulum at time t, given initial values ?? and uo. The total energy of the system is the kinetic energy plus gravitational potential energy Write down an expression for the energy as a function of ?, w, g, l and m. Add the energy calculation to your code. Use a time step in your code that keeps thel energy constant to better than 1% accuracy b) Often, the pendulum is approximated as a simple harmonic oscillator. To do this we assume the angle is small, so that sin ? and cos. 1-972 Add to your existing program the code to evolve the pendulum using the small angle formula. c) Take the mass of the pendulum to be m=15kg with length 1-2.4m, use g=9.8m/s' Take the initial angle initial angle of ??-?/3 radians and zero initial angular velocity, uwo-0. Evolve the system for 10 seconds, using both the pendulum and simple harmonic oscillator codes. Generate a figure with three subplots, the top showing angle ? vs time, the second angular velocity against time and the third energy vs time. d) Calculate the first time that the angular velocity is greater than zero, for both pendulum and harmonic oscillator. What fraction of a period does this time corresponds to? What is then the estimated period for the pendulum and the simple harmonic oscillator? How many oscillations before the approximation is wrong by 1 whole cycle? Damping and driving We can add a damping term to the harmonic oscillator (a force that acts proportional to and opposite to the angular velocity). Also, we can add a driving term that pushes the pendulum with a maximum torque of A at an angular frequency wp. In this case, the equation of motion of the oscillator is C d A dt2 l m dt m e) Implement both the damping and driving terms in your code (there's no need to keep the harmonic oscillator approximation) f) Two children of mass m-15kg sit on swings with l-2.4m and C/m -0.1s1. One is pulled to ?,-?/4 rad and released from rest. The other starts with ?,-0, ?,- 0 and is pushed with A/m = 0.1 s= aa-2 rad/s. Plot the motion of the two children (both position and velocity) for 60 seconds
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
