Question
1) Write a Python program that, inside a loop ,does several things: a) Asks the user for values of mass in kg, damping in N/(m/s),
1) Write a Python program that, inside a loop ,does several things:
a) Asks the user for values of mass in kg, damping in N/(m/s), and stiffness in N/m and appends the user's values to the ends of list variables that were
initially set to empty.
b) Prints out the natural frequency in Hz,the damping ratio, and the description of the system response for the user's most recently entered data.
c) Asks the user if they want to continue Then, when the user is done entering values, leave the loop. Print out a neat table with the user's values, the values for natural frequency and damping ratio, and the type system response, as given above. The table k m c x should start with header and unit rows, as shown in the example run below. Numerical values should be formatted wide enough to make neat columns and show 4 digits to the right of the decimal.
PYTHON 03 Please
3 12 2 Enter a mass in kilograms: Enter a stiffness in newtons/meter: Enter a damping in newtons/(meter/ second): Natural Frequency = 8.3183 Hz Damping Ratio = 0.1667 System Response = Underdamped Do another (y)? y 2 4 9 Enter a mass in kilograms: Enter a stiffness in newtons/meter: Enter a damping in newtons/(meter/ second): Natural Frequency = 0.2251 Hz Damping Ratio = 1.5910 System Response = Overdamped Do another (y) ? y 4 4 8 Enter a mass in kilograms: Enter a stiffness in newtons/meter: Enter a damping in newtons/(meter/ second): Natural Frequency = 8. 1592 Hz Damping Ratio = 1.0800 System Response = Critically Damped Do another (y) ? y Enter a mass in kilograms: 4 Enter a stiffness in newtons/meter: 8 Enter a damping in newtons/(meter/ second): 2 Natural Frequency = 0.2251 Hz Damping Ratio = 0.0000 System Response = Undamped Do another (y) ? n Summary: Mass Stiffness kg N/M Response Type Damping Omega_n Zeta N/(m/s) Hz 3.8000 2.8000 4.6000 4.8000 12.0090 4.6090 4.8900 8.6990 2.8890 0.3183 0.1667 9. eeee 0.2251 1.5910 8.8098 0.1592 1.8089 0.0000 0.2251 0.0000 Underdamped Overdamped Critically Damped Undamped 3 12 2 Enter a mass in kilograms: Enter a stiffness in newtons/meter: Enter a damping in newtons/(meter/ second): Natural Frequency = 8.3183 Hz Damping Ratio = 0.1667 System Response = Underdamped Do another (y)? y 2 4 9 Enter a mass in kilograms: Enter a stiffness in newtons/meter: Enter a damping in newtons/(meter/ second): Natural Frequency = 0.2251 Hz Damping Ratio = 1.5910 System Response = Overdamped Do another (y) ? y 4 4 8 Enter a mass in kilograms: Enter a stiffness in newtons/meter: Enter a damping in newtons/(meter/ second): Natural Frequency = 8. 1592 Hz Damping Ratio = 1.0800 System Response = Critically Damped Do another (y) ? y Enter a mass in kilograms: 4 Enter a stiffness in newtons/meter: 8 Enter a damping in newtons/(meter/ second): 2 Natural Frequency = 0.2251 Hz Damping Ratio = 0.0000 System Response = Undamped Do another (y) ? n Summary: Mass Stiffness kg N/M Response Type Damping Omega_n Zeta N/(m/s) Hz 3.8000 2.8000 4.6000 4.8000 12.0090 4.6090 4.8900 8.6990 2.8890 0.3183 0.1667 9. eeee 0.2251 1.5910 8.8098 0.1592 1.8089 0.0000 0.2251 0.0000 Underdamped Overdamped Critically Damped UndampedStep 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