JuliaControl / ControlSystems.jl

A Control Systems Toolbox for Julia
https://juliacontrol.github.io/ControlSystems.jl/stable/
Other
508 stars 85 forks source link

wrong frequency response of systems with delay #824

Closed fedeinthemix closed 1 year ago

fedeinthemix commented 1 year ago

The frequency response produced by bodeplot and freqresp for systems with delay is wrong. Here an example for a ZOH:

using ControlSystemsBase
using Plots
s = tf("s")
Ts = 0.1
bodeplot((1 - exp(-s*Ts))/s, hz=true)

The gain as s -> 0 should be 1.0, but it differs substantially. This happens for any value of Ts different from 1.0. Here the magnitude (blue) compared with the correct one red image

baggepinnen commented 1 year ago

You have forgotten to divide by Ts image

fedeinthemix commented 1 year ago

Me stupid! Thanks for the answer and sorry for the noise.