I was able to reproduce this error, and I believe it is a bug (although I am not an expert). As a workaround, it seems like you can do this: sys_d = c2d(ss(sys), 1) # transfer function to state space, then to discrete
Looking at the source, it looks like the method for transfer functions erroneously assumes that method is a keyword argument:
sys = ss(G)
sysd = c2d(sys, h, kwargs...)[1]
whereas the signature for state-space treats it as an optional (not a keyword) argument.
Would you be willing to file an issue? Also, your example would be good to build in as a test.
The docs say [sysd, x0map] = c2d(sys, Ts, method=:zoh)
with no semi-colon before method. It is true that the method can be left out for default :zoh. But if you want :foh you have to include it as an optional argument, and it doesn’t work with transfer functions:
julia> c2d(sys, 1, :foh)
ERROR: MethodError: no method matching c2d(::TransferFunction{Continuous,ControlSystems.SisoRational{Int64}}, ::Int64, ::Symbol)
Closest candidates are:
c2d(::StateSpace, ::Real, ::Symbol) at /Users/artkuo/.julia/packages/ControlSystems/H3Br2/src/discrete.jl:12
c2d(::TransferFunction, ::Any; kwargs...) at /Users/artkuo/.julia/packages/ControlSystems/H3Br2/src/discrete.jl:213
c2d(::DelayLtiSystem, ::Real, ::Any) at /Users/artkuo/.julia/packages/ControlSystems/H3Br2/src/delay_systems.jl:58
The same does work with state-space.
EDIT: Forgot to say docs for v0.5.3