MATLAB Examples

# Step response for 2nd order systems

The following example illustrate the change in peak time, settling time and percent overshoot as the poles of a 2nd order system move horizontaly, vertically and with fixed angle on the complex plane. The user should run each example seperately

## Constant peak time

```clear close all leg=[]; for j=1:8 sys=zpk([],[-j+5*i, -j-5*i],abs(-j+5*i)^2); figure(1) hold all step(sys) line=horzcat('poles= -',num2str(j), '+-5', 'i'); leg=strvcat(leg,line); legend(leg) figure(2) hold all pzmap(sys) pause end ```

## Constant settling time (approximately)

```clear close all leg=[]; for j=1:8 sys=zpk([],[-2+j*i, -2-j*i],abs(-2+j*i)^2); figure(1) hold all step(sys) line=horzcat('poles= -2', '+-', num2str(j), 'i'); leg=strvcat(leg,line); legend(leg) figure(2) hold all pzmap(sys) pause end ```

## Constant percent overshoot

```clear close all leg=[]; for j=1:8 sys=zpk([],[-j+2*j*i, -j-2*j*i],abs(j+2*j*i)^2); figure(1) hold all step(sys) % In order to create the legend string, I input the following line=horzcat('poles= -',num2str(j), '+-', num2str(2*j), 'i'); leg=strvcat(leg,line); legend(leg) figure(2) hold all pzmap(sys) pause end ```

## References

1. Norman N. Nise. Control Systems Engineering 6th ed. 2011. John Wiley & Sons.