State-space system identification using known states, inputs, outputs
5 views (last 30 days)
I am using System Identification Toolbox to identify a linear state-space model using n4sid algorithm. My model is a MISO. The data is formatted in a data object with several input channels and 1 output channel sampled with uniform sampling interval. The application of such identified model to act as a virtual sensor to estimate a quantity that can not be really measured using only input-output relation.
yEstimated = sim(mystatespacemodel, input_vector, estimated_state_from_previous_step, simopt);
However, during deployment I have to provide a vector of initial conditions besides the known input vector for each time instance. The states that the toolbox estimated during the fitting procedure are however artificial states, therefore I don't know in advance how I should initialize my model during deployment. Using the estimated initial conditions from the toolbox did not improve the results when I used them as an initial condition during deployment.
The idea now is to split some of the inputs as known states that can be used instead of the artificial states that Matlab derived in the form:
nx = size(x, 2);
sys = n4sid(u,y,x,nx,'Ts',Ts); % here is an extra input "x" which indicates the known states
% that should be used instead of the artificial states
I hope the question is clear and there is a solution for such problem.
Thanks in advance!
Rajiv Singh on 7 Nov 2022
Initial conditions are not a property of the model that you can estimate in advance. You really need to ask yourself regarding what you can assume regarding the system's state before the input is applied. As such, this must come from physical insight regarding the system's state.
Some common scenarios:
- State of rest: you may be able to set initial states to zero
- You have measurement history (I/O values) of the state that prevailed before the input was applied; this could be a steady-state at some operating condition. Consider using the data2state command to transform the past behavior history into an initial state vector.