spm_fx_lz.m 551 B

1234567891011121314151617181920
  1. function [y] = spm_fx_lz(x,u,P)
  2. % flow for Lorenz attractor
  3. % FORMAT [y] = spm_fx_lz(x,u,P)
  4. % x - state
  5. % u - input
  6. % P - parameters
  7. %__________________________________________________________________________
  8. % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
  9. % Karl Friston
  10. % $Id: spm_fx_lz.m 1961 2008-07-26 09:38:46Z karl $
  11. % flow for Lorenz attractor
  12. %--------------------------------------------------------------------------
  13. try
  14. P(3) = P(3)*(1 + u);
  15. end
  16. J = [-P(1) P(1) 0; (P(3) - x(3)) -1 -x(1); x(2) x(1) P(2)];
  17. y = J*x;