# nlarx model initial conditions

1 view (last 30 days)
Yannik on 10 Aug 2020
Commented: liu ke on 18 Mar 2022
Hello
i want to use a nlarx model with focus on simulation to model a system. The results i get with the nlarx command are good but the command sets the initial conditions automatically such that the first samples are perfectly matched as i read here: https://de.mathworks.com/matlabcentral/answers/51708-problem-with-system-identification-toolbox-and-sim-command. If i use the compare command with zero as initial condition the results are horrible. Is it possible to tell the nlarx function to use zero as initial condition before it estimates a model? It seems to be possible for the linear arx.
Thanks!

Rajiv Singh on 10 Aug 2020
You can prefix estimation data (both input and output signals) with nd zeros, where nd = maximum lag in the model. Initial conditions are more critical for nonlinear models since there is no guarantee that their effect will be transient. Wrong initial conditions may even lead the solution to a different invariant of the state-space than where the data was collected. Using the data samples themselves as initial conditions (for both estimation and validation) is probably the least risky thing to do. But check out FINDSTATES, FINDOP, DATA2STATES commands in System Identification Toolbox that give you different ways of finding and handling initial conditions for Nonlinear ARX models.
liu ke on 18 Mar 2022
Hi rajiv
Add ND 0 to the estimated data (both input and output signals), where ND = the maximum lag in the model. Do I just add zero to this one? Again, add the initial state value calculated with finop or data2State.
I added Max (na,nk) zeros to the training data u and y, which didn't work very well
thanks

liu ke on 17 Mar 2022
Hi rajiv
Add ND 0 to the estimated data (both input and output signals), where ND = the maximum lag in the model. Do I just add zero to this one? Again, add the initial state value calculated with finop or data2State.
I added Max (na,nk) zeros to the training data u and y, which didn't work very well
thanks

### Categories

Find more on Data Preparation Basics in Help Center and File Exchange

R2020a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by