Closed Johan-Gronqvist closed 9 months ago
You can change the tolerance to minreal
, for example:
julia> s = tf("s")
TransferFunction{Continuous, ControlSystemsBase.SisoRational{Int64}}
s
-
1
Continuous-time transfer function model
julia> g = 1/(s-1)^4
TransferFunction{Continuous, ControlSystemsBase.SisoRational{Int64}}
1
--------------------------
s^4 - 4s^3 + 6s^2 - 4s + 1
Continuous-time transfer function model
julia> g_tot_tf = [ 1/s*g; g; s*g; s*s*g; s*s*s*g ];
julia> g_tot = ss(g_tot_tf);
julia> g_tot.nx
21
julia> g_tot_m = minreal(g_tot);
julia> g_tot_m.nx
17
julia> g_tot_m = minreal(g_tot, 1e-12);
julia> g_tot_m.nx
5
Thanks! Apologies for the noise.
The following example works in Julia and Matlab, producing minimal representations of order four in both cases.
Increasing the order by one, Matlab produces a solution of order five, but the Julia result jumps to order 21.
(The corresponding
lsminreal
call usingMatrixPencils.jl
produces the same result, but I am creating an issue here inControlSystems.jl
, as I do not understand enough about matrix pencils to claim that that package has an issue.)I used ControlSystems 1.8.1 and Julia 1.9.3.
The matlab code was identical, except for the
@show
and some;
:and