Time varying parameters of a State-Space block

2 views (last 30 days)
cr
cr on 5 Oct 2013
Edited: cr on 7 Oct 2013
Out of curiosity, I tried to implement a lorenz attractor (an nonlinear system) with a statespace block (continuous) with time varying values of the [A] matrix. I did this using a simple s-function using Dwork vars. The update routine changes [A] matrix of the statespace block at each step. However when I compare the output with another implementation (in the same mdl file) which uses a direct matrix multiplication and an integrator the outputs differ (initially small, but grow eventually). Both implementations use same inputs and same initial conditions. I've been trying to understand why they differ for a while but can't seem to get a clue. Any idea? No reason to believe they cannot be expected to be the same. The output at the second integration timestep itself differs in 13th place after decimal and it grows soon.

Answers (0)

Community Treasure Hunt

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

Start Hunting!