Skip to main content

Assessing Safety for Control Systems Using Sum-of-Squares Programming

  • Chapter
  • First Online:
Polynomial Optimization, Moments, and Applications

Part of the book series: Springer Optimization and Its Applications ((SOIA,volume 206))

Abstract

In this chapter we introduce the concept of safety for control systems in both continuous and discrete time form. Given a system and a safe set, we say the system is safe if the system state remains inside the safe set for all initial conditions starting from the initial set. Control invariance can be employed to verify safety and design safe controllers. To this end, for general polynomial systems with semi-algebraic safe/initial sets, we show how Sum-of-Squares (SOS) programming can be used to construct invariant sets. For linear systems, evaluating invariance can be much more efficient by using ellipsoidal techniques and dealing with a series of SOS constraints. Following invariance analysis, safe control design and safety verification methods are proposed. We conclude this chapter by showing invariant set construction for both nonlinear and linear systems, and provide MATLAB code for reference.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 139.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Anevlavis, T., Tabuada, P.: A simple hierarchy for computing controlled invariant sets. In: Proceedings of the 23rd International Conference on Hybrid Systems: Computation and Control, pp. 1–11 (2020)

    Google Scholar 

  2. August, E., Barahona, M.: Finding positively invariant sets and proving exponential stability of limit cycles using sum-of-squares decompositions (2022). arXiv preprint. arXiv:2208.11599

    Google Scholar 

  3. Bertsekas, D.: Infinite time reachability of state-space regions by using feedback control. IEEE Trans. Autom. Control 17(5), 604–613 (1972)

    Article  MathSciNet  Google Scholar 

  4. Bertsekas, D.P., Rhodes, I.B.: On the minimax reachability of target sets and target tubes. Automatica 7(2), 233–247 (1971)

    Article  MathSciNet  Google Scholar 

  5. Blanchini, F., Miani, S.: Set-Theoretic Methods in Control, vol. 78. Springer, Berlin (2008)

    Book  Google Scholar 

  6. Bochnak, J., Coste, M., Roy, M.F.: Real Algebraic Geometry, vol. 36. Springer Science & Business Media, Berlin (2013)

    Google Scholar 

  7. Camacho, E.F., Alba, C.B.: Model Predictive Control. Springer Science & Business Media, Berlin (2013)

    Google Scholar 

  8. Clark, A.: A semi-algebraic framework for verification and synthesis of control barrier functions (2022). arXiv preprint. arXiv:2209.00081

    Google Scholar 

  9. Dawson, C., Gao, S., Fan, C.: Safe control with learned certificates: a survey of neural lyapunov, barrier, and contraction methods (2022). arXiv preprint. arXiv:2202.11762

    Google Scholar 

  10. Farkas, J.: Über die Theorie des einfachen Ungleichungen. J. Reine Angew. Mathematik 1902, 1–24 (1902)

    Article  Google Scholar 

  11. Helmberg, C., Rendl, F., Vanderbei, R.J., Wolkowicz, H.: An interior-point method for semidefinite programming. SIAM J. Optim. 6(2), 342–361 (1996)

    Article  MathSciNet  Google Scholar 

  12. Iannelli, A., Marcos, A., Lowenberg, M.: Robust estimations of the region of attraction using invariant sets. J. Franklin Inst. 356(8), 4622–4647 (2019)

    Article  MathSciNet  Google Scholar 

  13. Khalil, H.K.: Nonlinear Systems, vol. 115, 3rd edn. Patience Hall, Hoboken (2002)

    Google Scholar 

  14. Korda, M., Henrion, D., Jones, C.N.: Convex computation of the maximum controlled invariant set for polynomial control systems. SIAM J. Control. Optim. 52(5), 2944–2969 (2014)

    Article  MathSciNet  Google Scholar 

  15. Kouvaritakis, B., Cannon, M.: Model Predictive Control, vol. 38. Springer International Publishing, Switzerland (2016)

    Book  Google Scholar 

  16. Lindemann, L., Robey, A., Jiang, L., Tu, S., Matni, N.: Learning robust output control barrier functions from safe expert demonstrations (2021). arXiv preprint. arXiv:2111.09971

    Google Scholar 

  17. Lygeros, J.: On reachability and minimum cost optimal control. Automatica 40(6), 917–927 (2004)

    Article  MathSciNet  Google Scholar 

  18. Lygeros, J., Tomlin, C., Sastry, S.: Controllers for reachability specifications for hybrid systems. Automatica 35(3), 349–370 (1999)

    Article  MathSciNet  Google Scholar 

  19. Margellos, K., Lygeros, J.: Hamilton–Jacobi formulation for reach–avoid differential games. IEEE Trans. Autom. Control 56(8), 1849–1861 (2011)

    Article  MathSciNet  Google Scholar 

  20. Mitchell, I.M., Bayen, A.M., Tomlin, C.J.: A time-dependent Hamilton-Jacobi formulation of reachable sets for continuous dynamic games. IEEE Trans. Autom. Control 50(7), 947–957 (2005)

    Article  MathSciNet  Google Scholar 

  21. Morari, M., Lee, J.H.: Model Predictive Control: Past, Present and Future. Comput. Chem. Eng. 23(4–5), 667–682 (1999)

    Article  Google Scholar 

  22. Nagumo, M.: Über die Lage der Integralkurven gewöhnlicher Differentialgleichungen. Proc. Phys.-Math. Soc. Jpn., 3rd series 24, 551–559 (1942)

    Google Scholar 

  23. Oustry, A., Tacchi, M., Henrion, D.: Inner approximations of the maximal positively invariant set for polynomial dynamical systems. IEEE Control Syst. Lett. 3(3), 733–738 (2019)

    Article  MathSciNet  Google Scholar 

  24. Papachristodoulou, A., Anderson, J., Valmorbida, G., Prajna, S., Seiler, P., Parrilo, P.: Sostools version 3.00 sum of squares optimization toolbox for matlab (2013). arXiv preprint. arXiv:1310.4716

    Google Scholar 

  25. Prajna, S., Jadbabaie, A.: Safety verification of hybrid systems using barrier certificates. In: International Workshop on Hybrid Systems: Computation and Control, pp. 477–492. Springer, Berlin (2004)

    Google Scholar 

  26. Qin, S.J., Badgwell, T.A.: A survey of industrial model predictive control technology. Control. Eng. Pract. 11(7), 733–764 (2003)

    Article  Google Scholar 

  27. Robey, A., Hu, H., Lindemann, L., Zhang, H., Dimarogonas, D.V., Tu, S., Matni, N.: Learning control barrier functions from expert demonstrations. In: 59th IEEE Conference on Decision and Control (CDC), pp. 3717–3724. IEEE (2020)

    Google Scholar 

  28. Rungger, M., Tabuada, P.: Computing robust controlled invariant sets of linear systems. IEEE Trans. Autom. Control 62(7), 3665–3670 (2017)

    Article  MathSciNet  Google Scholar 

  29. Sturm, J.F.: Using SeDuMi 1.02, a MATLAB toolbox for optimization over symmetric cones. Optim. Methods Softw. 11(1–4), 625–653 (1999)

    Google Scholar 

  30. Tomlin, C.J., Lygeros, J., Sastry, S.S.: A game theoretic approach to controller design for hybrid systems. Proc. IEEE 88(7), 949–970 (2000)

    Article  Google Scholar 

  31. Wang, L., Han, D., Egerstedt, M.: Permissive barrier certificates for safe stabilization using sum-of-squares. In: 2018 Annual American Control Conference (ACC), pp. 585–590. IEEE (2018)

    Google Scholar 

  32. Wang, Z., Jungers, R.M., Ong, C.J.: Computation of the maximal invariant set of linear systems with quasi-smooth nonlinear constraints. In: 18th European Control Conference (ECC), pp. 3803–3808. IEEE (2019)

    Google Scholar 

  33. Wang, H., Margellos, K., Papachristodoulou, A.: Safety verification and controller synthesis for systems with input constraints (2022). arXiv preprint. arXiv:2204.09386

    Google Scholar 

  34. Wang, Z., Jungers, R.M., Ong, C.J.: Computation of invariant sets via immersion for discrete-time nonlinear systems. Automatica 147, 110686 (2023)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Han Wang .

Editor information

Editors and Affiliations

Appendix

Appendix

Program Code with SOSTOOLS

options.solver='sedumi'; % you need to add SeDuMi into work path % Constructing the vector field pvar x1 x2; x = [x1;x2]; f = [          x2;     +x1+x1ˆ3/3+x2]; gx = [x1ˆ2+x2+1;         x2ˆ2+x1+1]; limits = 1.5; % Define the safe set S >= 0 is safe bias = 0; S = -(x1-bias)ˆ2-(x2-bias)ˆ2+3; % Avoid a round region % Define the initial set I >= 0 I = -(x1-bias-0.4)ˆ2-(x2-bias-0.4)ˆ2+0.16; % Start from a round region % Initialize the SOSP prog = sosprogram(x); % The barrier function [prog,B] = sospolyvar(prog,monomials(x,0:4),'wscoeff'); % The multipliers [prog,sigma1] = sossosvar(prog,monomials(x,0:1)); [prog,sigma2] = sossosvar(prog,monomials(x,0:1)); [prog,sigma3] = sossosvar(prog,monomials(x,0:1)); % ============================= % Inequality constraints % Constraint 1: B(x) < 0 when S < 0 prog = sosineq(prog,-B+sigma1∗S-0.001); % 0.001 is used for strict inequality % Constraint 2: B(x) >= 0 when I >= 0 prog = sosineq(prog,B-sigma2∗I); % ============================= % Iterative procedure below, we interatively solve the problem, first find % a feasible control input % Initialize the control input SolU1 = 0; SolU2 = 0; % Initialize the barrier function g = [gx(1)∗SolU1;        gx(2)∗SolU2]; prog_barrier = prog; expr = diff(B,x1)∗(f(1,1)+g(1,1))+diff(B,x2)∗(f(2,1)+g(2,1)); prog_barrier = sosineq(prog_barrier,expr); % Solve the problem prog_barrier = sossolve(prog_barrier,options); % Get the resulting invariant set SolB = sosgetsol(prog_barrier,B); clear prog_barrier % Initialize the polynomial multiplier SolLambda1 = 0; SolLambda2 = 0; SolLambda3 = 0; SolLambda4 = 0; SolLambda5 = 0; for i=1:20     % ============================     % First fix the multiplier, control input, solve     for the invariant set     % ============================     % Constraint 1: dB/dx∗f(x)+alpha B > 0 when B = 0     g = [gx(1)∗SolU1;            gx(2)∗SolU2];     prog_barrier = prog;     expr = diff(B,x1)∗(f(1,1)+g(1,1))+diff(B,x2)∗(f(2,1)+g(2,1))     +SolLambda1∗B;     prog_barrier = sosineq(prog_barrier,expr);     prog_barrier = sosineq(prog_barrier,-SolU1+limits-SolLambda     2∗B);     prog_barrier = sosineq(prog_barrier,SolU1+limits-SolLambda     3∗B);     prog_barrier = sosineq(prog_barrier,-SolU2+limits-SolLambda     4∗B);     prog_barrier = sosineq(prog_barrier,SolU2+limits-SolLambda     5∗B);     % Enlarge the area     expr = B-sigma3∗SolB;     prog_barrier = sosineq(prog_barrier,expr);     % Solve the problem     prog_barrier = sossolve(prog_barrier,options);     % Get the resulting invariant set     SolB = sosgetsol(prog_barrier,B);     % Delete the temporary variable     clear prog_barrier;     % ============================     % Then fix the invariant set, solve for the control input     prog_u = sosprogram(x);     [prog_u,u1] = sospolyvar(prog_u,monomials(x,0:3));     [prog_u,u2] = sospolyvar(prog_u,monomials(x,0:3));     g = [gx(1)∗u1;            gx(2)∗u2];     expr = diff(SolB,x1)∗(f(1,1)+g(1,1))+diff(SolB,x2)∗(f(2,1)     +g(2,1))+SolLambda1∗SolB;     prog_u = sosineq(prog_u,expr);     %  Control limits     [prog_u,lambda2] = sospolyvar(prog_u,monomials(x,0:2));     [prog_u,lambda3] = sospolyvar(prog_u,monomials(x,0:2));     [prog_u,lambda4] = sospolyvar(prog_u,monomials(x,0:2));     [prog_u,lambda5] = sospolyvar(prog_u,monomials(x,0:2));     prog_u = sosineq(prog_u,-u1+limits-lambda2∗SolB);     prog_u = sosineq(prog_u,u1+limits-lambda3∗SolB);     prog_u = sosineq(prog_u,-u2+limits-lambda4∗SolB);     prog_u = sosineq(prog_u,u2+limits-lambda5∗SolB);     prog_u = sossolve(prog_u,options);     % Get the control input     SolU1 = sosgetsol(prog_u,u1);     SolU2 = sosgetsol(prog_u,u2);     % Get the multipliers     SolLambda2 = sosgetsol(prog_u,lambda2);     SolLambda3 = sosgetsol(prog_u,lambda3);     SolLambda4 = sosgetsol(prog_u,lambda4);     SolLambda5 = sosgetsol(prog_u,lambda5);     % Delete the temporary variable     clear prog_u;     % ============================     % Then fix the invariant set, solve for the multipler lambda     prog_lambda = sosprogram(x);     [prog_lambda,lambda1] = sospolyvar(prog_lambda,monomials(x,     0:2));     g = [gx(1)∗SolU1;            gx(2)∗SolU2];     expr = diff(SolB,x1)∗(f(1,1)+g(1,1))+diff(SolB,x2)∗(f(2,1)+     g(2,1))+lambda1∗SolB;     prog_lambda = sosineq(prog_lambda,expr);     % Solve the problem     prog_lambda = sossolve(prog_lambda,options);     % Get the resulting polynomial multipler     SolLambda1 = sosgetsol(prog_lambda,lambda1);     % Delete the temproray variable     clear prog_lambda; end

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Wang, H., Margellos, K., Papachristodoulou, A. (2023). Assessing Safety for Control Systems Using Sum-of-Squares Programming. In: Kočvara, M., Mourrain, B., Riener, C. (eds) Polynomial Optimization, Moments, and Applications. Springer Optimization and Its Applications, vol 206. Springer, Cham. https://doi.org/10.1007/978-3-031-38659-6_7

Download citation

Publish with us

Policies and ethics