Question: Your task is to write a Python program that uses numerical methods to simulate the motion of a 1-meter long pendulum with a mass of

 Your task is to write a Python program that uses numerical

Your task is to write a Python program that uses numerical methods to simulate the motion of a 1-meter long pendulum with a mass of 1 kg attached to the end. It is slightly different from last-week's assignment in that the Euler integration we have been using makes the simulation go unstable. Your program will do the following ... Task 1 1. It will prompt the user for the initial angle (in degrees) of the pendulum. You will assume the initial swing speed is zero. There are no sources of energy dissipation in this problem. The total mechanical energy is conserved. 2. It will compute, numerically, using an Euler integrator, the subsequent motion (deflection angle as a function of time) of the pendulum for at least 5 complete swings. Additionally, the program will compute the kinetic, potential, and total energy of the pendulum as a function of time. 3. Do this for 3 different time-step sizes. Plot all 3 motion solutions, with a legend, on a single plot. Plot all 3 energy solutions (with legends to indicate kinetic, potential, and total energy) on 3 separate plots. Your plots for Task 1 are to demonstrate the Euler-integration instability and that the stability is worse for larger step sizes. Include comments to this effect in your write-up. Task 2 4. Update your simulation to utilize the Euler-Cromer integrator described in Example 3.2 of Giordano and Nakanishi. Recreate all the previous plots using the Euler- Cromer method. Make sure your plots illustrate that stability (and energy conservation) have been restored to your simulation. Include comments to this effect in your write-up. Your task is to write a Python program that uses numerical methods to simulate the motion of a 1-meter long pendulum with a mass of 1 kg attached to the end. It is slightly different from last-week's assignment in that the Euler integration we have been using makes the simulation go unstable. Your program will do the following ... Task 1 1. It will prompt the user for the initial angle (in degrees) of the pendulum. You will assume the initial swing speed is zero. There are no sources of energy dissipation in this problem. The total mechanical energy is conserved. 2. It will compute, numerically, using an Euler integrator, the subsequent motion (deflection angle as a function of time) of the pendulum for at least 5 complete swings. Additionally, the program will compute the kinetic, potential, and total energy of the pendulum as a function of time. 3. Do this for 3 different time-step sizes. Plot all 3 motion solutions, with a legend, on a single plot. Plot all 3 energy solutions (with legends to indicate kinetic, potential, and total energy) on 3 separate plots. Your plots for Task 1 are to demonstrate the Euler-integration instability and that the stability is worse for larger step sizes. Include comments to this effect in your write-up. Task 2 4. Update your simulation to utilize the Euler-Cromer integrator described in Example 3.2 of Giordano and Nakanishi. Recreate all the previous plots using the Euler- Cromer method. Make sure your plots illustrate that stability (and energy conservation) have been restored to your simulation. Include comments to this effect in your write-up

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!