Skip to main content

Inferring Switched Nonlinear Dynamical Systems


Identification of dynamical and hybrid systems using trajectory data is an important way to construct models for complex systems where derivation from first principles is too difficult. In this paper, we study the identification problem for switched dynamical systems with polynomial ODEs. This is a difficult problem as it combines estimating coefficients for nonlinear dynamics and determining boundaries between modes. We propose two different algorithms for this problem, depending on whether to perform prior segmentation of trajectories. For methods with prior segmentation, we present a heuristic segmentation algorithm and a way to classify themodes using clustering. Formethods without prior segmentation, we extend identification techniques for piecewise affine models to our problem. To estimate derivatives along the given trajectories, we use Linear MultistepMethods. Finally, we propose a way to evaluate an identified model by computing a relative difference between the predicted and actual derivatives. Based on this evaluation method, we perform experiments on five switched dynamical systems with different parameters, for a total of twenty cases. We also compare with three baseline methods: clustering with DBSCAN, standard optimization methods in SciPy and identification of ARX models in Matlab, as well as with state-of-the-art identification method for piecewise affine models. The experiments show that our two methods perform better across a wide range of situations.

This is a preview of subscription content, access via your institution.


  1. [ACZ+20]

    An J, Chen M, Zhan B, Zhan N, Zhang M (2020) Learning one-clock timed automata. In Proceedings of 26th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 444–462. Springer

  2. [AL89]

    Auger, I., Lawrence, C.: Algorithms for the optimal identification of segment neighborhoods. Bulletin of Mathematical Biology 51(1), 39–54 (1989)

    MathSciNet  Article  Google Scholar 

  3. [Ang87]

    Angluin, D.: Learning regular sets from queries and counterexamples. Information and computation 75(2), 87–106 (1987)

    MathSciNet  Article  Google Scholar 

  4. [AS14]

    Alur R, Singhania N (2014) Precise piecewise affine models from input-output data. In Proceedings of the 14th International Conference on Embedded Software, pp. 3(1)–3(10)

  5. [AWZ+ss]

    An, J., Wang, L., Zhan, B., Zhan, N., Zhang, M.: Learning real-time automata. In press, SCIENCE CHINA Information Sciences (2021)

    Google Scholar 

  6. [BDG+20]

    Bartocci, E., Deshmukh, J., Gigler, F., Mateis, C., Ničković, D., Qin, X.: Mining shape expressions from positive examples. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 39(11), 3809–3820 (2020)

    Article  Google Scholar 

  7. [BG08]

    Butcher JC, Goodwin N (2008) Numerical methods for ordinary differential equations, volume 2. Wiley Online Library

  8. [BGPV05]

    Bemporad, A., Garulli, A., Paoletti, S., Vicino, A.: A bounded-error approach to piecewise affine system identification. IEEE Transactions on Automatic Control 50(10), 1567–1580 (2005)

    MathSciNet  Article  Google Scholar 

  9. [BHKL09]

    Bollig B, Habermehl P, Kern C, Leucker M (2009) Angluin-style learning of NFA. In Proceedings of the 21st International Joint Conference on Artificial Intelligence, pp. 1004–1009

  10. [BIB11]

    Baptista R, Ishihara JY, Borges GA (2011) Split and merge algorithm for identification of piecewise affine systems. In Proceedings of the 2011 American Control Conference, pp. 2018–2023

  11. [BPK16]

    Brunton, S., Proctor, J., Kutz, J.N.: Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences 113(15), 3932–3937 (2016)

    MathSciNet  Article  Google Scholar 

  12. [BVVB05]

    Borges J, Verdult V, Verhaegen M, Botto MA (2005) A switching detection method based on projected subspace classification. In Proceedings of the 44th IEEE Conference on Decision and Control, pp. 344–349

  13. [DD17]

    Drews S, DAntoni L (2017) Learning symbolic automata. In Proceedings of the 23rd International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 173–189. Springer

  14. [Eyk74]

    Eykhoff, P.: System Identification and State Estimation. Wiley (1974)

    MATH  Google Scholar 

  15. [FCC+08]

    Farzan A, Chen Y-F, Clarke EM, Tsay Y-K, Wang B-Y (2008) Extending automated compositional verification to the full class of omega-regular languages. In Proceedings of the 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 2–17. Springer

  16. [FMLM03]

    Ferrari-Trecate, G., Muselli, M., Liberati, D., Morari, M.: A clustering technique for the identification of piecewise affine systems. Automatica 39(2), 205–217 (2003)

    MathSciNet  Article  Google Scholar 

  17. [GAG+00]

    Goldberger, A.L., Amaral, L.A.N., Glass, L., Hausdorff, J.M., Ivanov, PCh., Mark, R.G., Mietus, J.E., Moody, G.B., Peng, C.-K., Eugene Stanley, H.: Physiobank, physiotoolkit, and physionet: Components of a new research resource for complex physiologic signals. Circulation 101(23), e215–e220 (2020)

    Google Scholar 

  18. [GPV12]

    Garulli, A., Paoletti, S., Vicino, A.: A survey on switched and piecewise affine system identification. IFAC Proceedings Volumes 45(16), 344–355 (2012)

    Article  Google Scholar 

  19. [Hen96]

    Henzinger TA (1996) The theory of hybrid automata. In Proceedings of the 11th Annual IEEE Symposium on Logic in Computer Science, pp. 278–292. IEEE Computer Society

  20. [HV05]

    Hashambhoy Y, Vidal R (2005) Recursive identification of switched ARX models with unknown number of models and unknown orders. In Proceedings of the 44th IEEE Conference on Decision and Control, pp. 6115–6121. IEEE

  21. [KD19]

    Keller R, Du Q (2019) Discovery of dynamics using linear multistep methods

  22. [LB08]

    Lauer F, Bloch G (2008) Switched and piecewise nonlinear hybrid system identification. In Proceedings of the 11th International Workshop on Hybrid Systems: Computation and Control, pp. 330–343. Springer

  23. [LBG18]

    Lamrani I, Banerjee A, Gupta SKS (2018) Hymn: mining linear hybrid automata from input output traces of cyber-physical systems. In Proceedings of the 2018 IEEE Industrial Cyber-Physical Systems, pp. 264–269. IEEE

  24. [LBV10]

    Lauer F, Bloch G, Vidal R (2010) Nonlinear hybrid system identification with kernel models. In Proceedings of the 49th IEEE Conference on Decision and Control, pp. 696–701. IEEE

  25. [LCZL17]

    Li Y, Chen Y-F, Zhang L, Liu D (2017) A novel learning algorithm for büchi automata based on family of dfas and classification trees. In Proceedings of the 23rd International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 208–226, Berlin, Heidelberg, Springer Berlin Heidelberg

  26. [Lju99]

    Ljung, L.: System Identification: Theory for the User. Prentice Hall, Upper Saddle River, New Jersey (1999)

    MATH  Google Scholar 

  27. [Lju15]

    Ljung, L.: System identification: An overview. Springer, In Encyclopedia of Systems and Control (2015)

    Google Scholar 

  28. [Lor63]

    Lorenz, E.N.: Deterministic nonperiodic flow. Journal of Atmospheric Sciences 20(2), 130–148 (1963)

    MathSciNet  Article  Google Scholar 

  29. [MKY11]

    Mueen A, Keogh E, Young N (2011) Logical-shapelets: an expressive primitive for time series classification. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 1154–1162

  30. [MM14]

    Maler O, Mens I-E (2014) Learning regular languages over large alphabets. In Proceedings of the 20th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 485–499. Springer

  31. [Moo58]

    Moore, E.F.: Gedanken-experiments on sequential machines. Annals of Mathematics 34, 129–153 (1958)

    MathSciNet  Google Scholar 

  32. [MRBF15]

    Medhat R, Ramesh S, Bonakdarpour B, Fischmeister S (2015) A framework for mining hybrid automata from input/output traces. In Proceedings of the 2015 International Conference on Embedded Software, pp. 177–186. IEEE

  33. [NQF+19]

    Ničković D, Qin X, Ferrère T, Mateis C, Deshmukh J (2019) Shape expressions for specifying and extracting signal features. In Proceedings of the 19th International Conference on Runtime Verification, pp. 292–309. Springer

  34. [NSV+12]

    Niggemann O, Stein , Vodencarevic A, Maier A, Büning HK (2012) Learning behavior models for hybrid timed systems. In Proceedings of the 26th AAAI Conference on Artificial Intelligence. AAAI Press

  35. [OG92]

    Oncina J, Garcia P (1992) Identifying regular languages in polynomial time. In Advances in Structural and Syntactic Pattern Recognition, Volumn 5 of Series in Machine Perception and Artificial Intelligence, pp. 99–108. World Scientific

  36. [OLB10]

    Ohlsson, H., Ljung, L., Boyd, S.: Segmentation of arx-models using sum-of-norms regularization. Automatica 46(6), 1107–1111 (2010)

    MathSciNet  Article  Google Scholar 

  37. [Oza16]

    Ozay N (2016) An exact and efficient algorithm for segmentation of ARX models. In Proceedings of the 2016 American Control Conference, pp. 38–41. IEEE

  38. [Pen55]

    Penrose, R.: A generalized inverse for matrices. Mathematical Proceedings of the Cambridge Philosophical Society 51(3), 406–413 (1955)

    Article  Google Scholar 

  39. [PJFV07]

    Paoletti S, Juloski ALj (2007) Giancarlo Ferrari-Trecate, and René Vidal. Identification of hybrid systems a tutorial. European journal of control, 13(2-3):242–260

  40. [POTN03]

    Peng H, Ozaki T, Toyoda Y, Nakano K (2003) Nonlinear system modelling using the rbf neural network-based regressive model. IFAC Proceedings Volumes, 36(16):333–338, Proceedings of the 13th IFAC Symposium on System Identification

  41. [SG09]

    Shahbaz M, Groz R (2009) Inferring mealy machines. In Proceedings of the 16th International Symposium on Formal Methods, pp. 207–222. Springer

  42. [SHSZ19]

    Soto MG, Henzinger TA, Schilling C, Zeleznik L (2019) Membership-based synthesis of linear hybrid automata. In Proceedings of the 31st International Conference on Computer Aided Verification, pp. 297–314. Springer

  43. [TAB+19]

    Tappler M, Aichernig BK, Bacci G, Eichlseder M, Larsen KG (2019) \({L}^*\)-based learning of Markov decision processes. In Proceedings of the 23rd International Symposium on Formal Methods, pp. 651–669

  44. [Vaa17]

    Vaandrager, F.: Model learning. Communications of the ACM 60(2), 86–95 (2017)

    Article  Google Scholar 

  45. [VdWW11]

    Verwer, S., de Weerdt, M., Witteveen, C.: The efficiency of identifying timed automata and the power of clocks. Information and Computation 209(3), 606–625 (2011)

    MathSciNet  Article  Google Scholar 

  46. [VdWW12]

    Verwer, S., de Weerdt, M., Witteveen, C.: Efficiently identifying deterministic real-time automata from labeled data. Machine Learning 86(3), 295–333 (2012)

    MathSciNet  Article  Google Scholar 

  47. [XPTP20]

    Xu, W., Peng, H., Tian, X., Peng, X.: DBN based SD-ARX model for nonlinear time series prediction and analysis. Applied Intelligence 50(12), 4586–4601 (2020)

    Article  Google Scholar 

Download references


This work has been partially funded by NSFC under grant No. 61625206, 61972284, 61732001 and 61872341, and by the CAS Pioneer Hundred Talents Program under grant No. Y9RC585036.

Author information



Corresponding author

Correspondence to Bohua Zhan.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Zhiming Liu, Xiaoping Chen, Ji Wang and Jim Woodcock

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Jin, X., An, J., Zhan, B. et al. Inferring Switched Nonlinear Dynamical Systems. Form Asp Comp 33, 385–406 (2021).

Download citation


  • System identification
  • Black-box inference
  • Grey-box inference
  • Switched dynamical systems
  • Linear multistep methods