Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LsimWorkspace not working for discrete transfer functions #833

Open
bryaan opened this issue Apr 28, 2023 · 1 comment
Open

LsimWorkspace not working for discrete transfer functions #833

bryaan opened this issue Apr 28, 2023 · 1 comment

Comments

@bryaan
Copy link

bryaan commented Apr 28, 2023

Why won't LsimWorkspace work with a discrete transfer function specified as system?

MSD = tf([2000.0],[1600.0, 40, 1])
sys = MSD

Ts = 250000
dsys = c2d(sys, Ts)

ws = LsimWorkspace(dsys, length(datetimes))
y, t, x, uout = lsim!(ws, dsys,u,t)


MethodError: no method matching LsimWorkspace(::TransferFunction{Discrete{Int64}, ControlSystemsBase.SisoRational{Float64}}, ::Int64)
Closest candidates are:
  LsimWorkspace(::AbstractStateSpace, ::Int64) at ~/.julia/packages/ControlSystemsBase/eWEYr/src/timeresp.jl:26

@baggepinnen
Copy link
Member

You cannot simulate a transfer function, under the hood, transfer functions are always converted to statespace before simulation. To create the workspace, you have to convert to statespace yourself first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants