Local Lyapunov analysis
For comparison with neural Lyapunov methods, we also provide a function for local Lyapunov analysis by linearization.
NeuralLyapunov.get_quadratic_lyapunov_function — Function
get_quadratic_lyapunov_function(dynamics; <keyword_arguments>)Get a quadratic Lyapunov function for the linearization of the given system around the fixed point. Return the Lyapunov function and its time derivative.
When the system is closed-loop, the continuous-time Lyapunov equation ($A^T P + P A + Q = 0$) is solved directly using the supplied Q (defaults to the identity matrix). The resulting Lyapunov function is then $V(x) = (x - x_0)^T P (x - x_0)$.
When the system is open-loop, the LQR problem is solved to find a linear feedback controller and its associated quadratic Lyapunov function.
Positional Arguments
dynamics: the dynamical system being analyzed, represented as aSystemor the functionfsuch thatẋ = f(x[, u], p, t); either way, the ODE should not depend on time and onlyt = 0will be used. Ifdynamics isa System, callmtkcompile(dynamics)beforeNeuralLyapunovPDESystem, ormtkcompile(dynamics; inputs = ..., split = false)if the system has unbound inputs.
Keyword Arguments
fixed_point: the equilibrium being analyzed, around which to linearize the system (defaults to the origin, dimension inferred fromQorx_dimif available).Q: The weighting matrix for the state in the Lyapunov equation or the LQR problem (defaults to the identity matrix).R: The weighting matrix for the control input in the LQR problem (only used when the system is open-loop; defaults to the identity matrix).p: the values of the parameters of the dynamical system being analyzed; defaults toSciMLBase.NullParameters(); not used whendynamics isa System, then use the default parameter values ofdynamics.u_eq: The equilibrium control input (only used when the system is open-loop`; defaults to zero control input).u_dim: The dimension of the control vector (only used when the system is open-loop and!(dynamics isa System)); inferred fromRoru_eqif available.x_dim: The dimension of the state vector (only used whendynamicsis not aSystemnor anODEFunctionnor anODEInputFunction); inferred fromQorfixed_pointif available.