I have a test problem to try out the n4sid function in the System Identification Toolbox.
I have simulated a simple SISO second order system. The only interesting feature is that it is proper but not strictly proper. I can get a good fit in reasonable time using tfest, but I'd like to use n4sid to learn how to use it and get good results. (ssest takes too long on this problem.)
The code below produces this graph, with test taking 28 seconds and n4sid taking 32 seconds.
ftest is almost spot on, but as you can see, n4sid is not close to the correct solution.
What should I do to tweak n4sid to get a better solution? A secondary question is what do I do to make n4sid return a continuous time model? The help says "For estimating a continuous-time model, specify 'Ts'/0 as name-value pair" which is what I thought I did, but the model returned is discrete time.
m = idtf([1 0 0],[1 0.1 1]);
[B,A] = butter(4,0.75);
init_sys = idtf([NaN 0 0],[1 NaN NaN]);
init_sys.Structure.num.Free([2,3]) = false;