Function wbw:
finding the bandwidth frequency from the damping ratio and peak or settling time

Below is the function wbw.m. This function will return the approximate bandwidth frequency, given the damping ratio and the rise or settling time. To use wbw.m in MATLAB, enter wbw at the command line. You will be prompted for a damping ratio. You will then be asked to enter 0 if you are using a settling time or 1 if you are using a peak time. Finally you will be asked for the desired settling or peak time, and the bandwidth frequency will be returned. Copy the following text into a file wbw.m, and save it where MATLAB will be able to find it (such as in the directory that you run MATLAB from).

function[] = wbw() DR = input('Damping Ratio? '); n = 0; n = input('Settling Time(0) or Peak Time(1)? '); if n == 0 ts = input('Settling Time? '); temp1 = sqrt((4*DR^4) - (4*DR^2) +2); temp2 = 1- (2*DR^2); temp3 = 4/(ts*DR); Wbw = temp3*sqrt(temp1 + temp2) end if n ==1 ts = input('Peak Time? '); temp1 = sqrt((4*DR^4) - (4*DR^2) +2); temp2 = 1- (2*DR^2); temp3 = ts*sqrt( 1- DR^2); temp4 = pi/temp3; Wbw = temp4*sqrt(temp1 + temp2) end