dReal4
control.h
1 #pragma once
2 
3 #include <cmath>
4 #include <numeric>
5 #include <ostream>
6 #include <vector>
7 
8 #include "dreal/solver/config.h"
10 #include "dreal/util/box.h"
11 #include "dreal/util/optional.h"
12 
13 namespace dreal {
14 // Given a dynamic system `xᵢ = fᵢ(x)`, checks that a given candidate
15 // function `V` is a Lyapunov function of the system within a ball
16 // bounded by `ball_lb` and `ball_ub`, that is, `ball_lb ≤ sqrt(∑xᵢ²)
17 // ≤ ball_ub`. It uses `config` to check its delta-satisfiability when
18 // it looks for a counterexample.
19 optional<Box> CheckLyapunov(const std::vector<Variable>& x,
20  const std::vector<Expression>& f,
21  const Expression& V, double ball_lb, double ball_ub,
22  Config config);
23 
24 // Given a time-varying dynamic system `xᵢ = fᵢ(x, t)`, checks that a
25 // given candidate function `V` is a Lyapunov function of the system
26 // within a ball bounded by `ball_lb` and `ball_ub`, that is, `ball_lb
27 // ≤ sqrt(∑xᵢ²) ≤ ball_ub` and `t_lb ≤ t ≤ t_ub`. It uses `config` to
28 // check its delta-satisfiability when it looks for a counterexample.
29 optional<Box> CheckLyapunov(const std::vector<Variable>& x, const Variable& t,
30  const std::vector<Expression>& f,
31  const Expression& V, double ball_lb, double ball_ub,
32  double t_lb, double t_ub, Config config);
33 
34 /// Given a partially specified candidate function `V`, synthesizes a
35 /// Lyapunov function of a dynamic system `xᵢ = fᵢ(x)` within a ball
36 /// bounded by `ball_lb` and `ball_ub`. The candidate function `V(c,
37 /// x)` should satisfy the following conditions:
38 ///
39 /// - ∃c.∀x. x ∈ ball → (V(c, x) ≥ 0 ∧ V̇(c, x) ≤ 0)
40 /// - ∃c. V(c, 0) = 0
41 /// - ∃c. c_lb ≤ c ≤ c_ub
42 optional<Box> SynthesizeLyapunov(const std::vector<Variable>& x,
43  const std::vector<Expression>& f,
44  const Expression& V, double ball_lb,
45  double ball_ub, double c_lb, double c_ub,
46  Config config);
47 
48 /// Given a partially specified candidate function `V`, synthesizes a
49 /// Lyapunov function of a time-varying dynamic system `xᵢ = fᵢ(x, t)` within a
50 /// ball bounded by `ball_lb` and `ball_ub`. The candidate function `V(c, x)`
51 /// should satisfy the following conditions:
52 ///
53 /// - ∃c. ∀x,t. (x ∈ ball ∧ t ∈ [t_lb, t_ub]) → (V(c, x) ≥ 0 ∧ V̇(c, x) ≤ 0)
54 /// - ∃c. V(c, 0) = 0
55 /// - ∃c. c_lb ≤ c ≤ c_ub
56 optional<Box> SynthesizeLyapunov(const std::vector<Variable>& x,
57  const Variable& t,
58  const std::vector<Expression>& f,
59  const Expression& V, double ball_lb,
60  double ball_ub, double c_lb, double c_ub,
61  double t_lb, double t_ub, Config config);
62 
63 } // namespace dreal
optional< Box > SynthesizeLyapunov(const vector< Variable > &x, const vector< Expression > &f, const Expression &V, const double ball_lb, const double ball_ub, const double c_lb, const double c_ub, Config config)
Given a partially specified candidate function V, synthesizes a Lyapunov function of a dynamic system...
Definition: control.cc:80
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
This is the header file that we consolidate Drake&#39;s symbolic classes and expose them inside of dreal ...