All problems
Damping Ratio from Overshoot
Problem
For a second-order underdamped system with percent overshoot Mp (as a fraction), the damping ratio is
zeta = -ln(Mp) / sqrt(pi^2 + ln(Mp)^2)
Given Mp in (0, 1), return zeta. A larger overshoot means a smaller damping ratio.
Hint
Mp = exp(-pi*zeta / sqrt(1 - zeta^2)) inverted gives this formula.
Test cases
case 1
in: [0.5]
expected: 0.2154537619662468
case 2
in: [0.1]
expected: 0.5911550337988976
case 3
in: [0.25]
expected: 0.4037127519434207
case 4
in: [0.163]
expected: 0.5000425292061115
Starter codePython
def damping_from_overshoot(mp):
# Your code here
pass4 test cases · run your code against them in the editor