有 PID 控制器的闭环响应
pid = PIDTune[TransferFunctionModel[Unevaluated[{{(1/(0.4s + 1)(0.5s + 1)^2)}}], s, SamplingPeriod -> None, SystemsModelLabels -> None], "PID", "PIDData"];对一个 SquareWave 过程干扰的输出和控制响应:
d = SquareWave[t];
yres1 = OutputResponse[pid["DisturbanceOutput"], d, {t, 0, 5}];
ures1 = OutputResponse[pid["DisturbanceControl"], d, {t, 0, 5}];{Plot[yres1, {t, 0, 5}, PlotRange -> All], Plot[ures1, {t, 0, 5}, PlotRange -> All]}对一个 UnitBox 参考信号的输出和控制响应:
r = UnitBox[t];
yres2 = OutputResponse[pid["ReferenceOutput"], r, {t, 0, 5}];
ures2 = OutputResponse[pid["ReferenceControl"], r, {t, 0, 5}];{Plot[yres2, {t, 0, 5}, PlotRange -> All], Plot[ures2, {t, 0, 5}, PlotRange -> All]}m = 0.2t;
yres3 = OutputResponse[pid["SensorOutput"], m, {t, 0, 5}];
ures3 = OutputResponse[pid["SensorControl"], m, {t, 0, 5}];{Plot[yres3, {t, 0, 5}, PlotRange -> All], Plot[ures3, {t, 0, 5}, PlotRange -> All]}