You are on page 1of 2

ECE/CS 584: Embedded and cyberphysical system verification Fall 2021

Your name, netid Homework 3: Hybrid models


Due October 22nd 11:59pm

Typeset your solutions using LATEX zip your writeup (.pdf) and code (.py) in a single file called
nedid-584-F21.zip and upload this file through Canvass++.

Problem 1. (15 points). Consider a deterministic hybrid automaton A = (V, Θ, A, D, T ). For


every action a ∈ A, the transition is specified by a guard (precondition) pre a ⊆ val(V ) and an
effect function eff a : val(V ) → val(V ). Every trajectory τ ∈ T is solution of some differential
equation.
Let α(x0 , t) be the state reached by the execution of A from the initial state x0 at time t. Assuming
that all the eff a functions are continuous, show that α(x0 , t) is a continuous function of x0 . Start
by writing the definition of an execution α in terms of pre a , eff a , and solutions.

Problem 2. (7 + 3 = 10 points). (a) Given any hybrid automaton A = (V, Θ, A, D, T ), state a


sufficient condition to check that A does not have any zeno executions. Prove the stated condition.
The condition should be in terms of the transitions D and the trajectories T . For convenience, you
can also write the conditions in terms of pre a , eff a , the differential equations defining T , the mode
invariants, etc. Just make your assumptions explicit.
(b) Comment on how your condition could be implemented in a nozeno checker program for an-
alyzing hybrid automata. The checker program could used SMT solvers, linear programming, or
other optimization tools as subroutines.

Problem 3. Billiards model (10 + 10 + 10 + 5 = 35 points) (a) Consider an idealized billiard


table of length a > 0 and width b > 0. The table has no pockets; its surface has no friction; and
its boundary bounces the balls perfectly. Write a hybrid automaton model A of the position of
two balls of equal mass on this table. That is, write the code specifying the automaton using the
language we have been using in lectures.
More details. The balls have some initial velocities. A ball bounces off a wall when its position is
at the boundary. Balls collide whenever |x1 − x2 | ≤ ε and |y1 − y2 | ≤ ε and their velocity vectors
are pointing towards each other. Here ε > 0 is a small positive constant. Whenever a bounce
occurs, the appropriate velocity changes sign. Whenever a collision occurs, the balls exchange
their velocity vectors. Make all the variables internal. Wall bounces are modeled by an output
action called bounce, and each collision is modeled by an output action collision.
(b) State and prove conservation of speed along each axis as an invariant property of the automa-
ton A.
(c) Write a program to simulate A. Animate or plot the executions of the balls on the table. Pro-
vide clear instructions for changing the initial positions and velocities in your simulations. It will

1
be nice if you can develop the simulation in the form of a sharable online notebook (e.g., using
https://colab.research.google.com/ or https://openprocessing.org/).
(d) (Open-ended question) Consider the billiard table with a single ball. The ball is said to reach
a fixed orbit if after a while it does not visit any new points on the table. Prove or disprove this
statement: For every initial position and velocity of the ball, it eventually reaches a fixed orbit. Does this
statement also hold for every possible choice of a and b?

Problem 4. Satellites (10 + 5 = 15 points). (a) Consider two satellites orbiting Earth in circular
orbits with constant angular speeds ω1 and ω2 . Write a hybrid automaton model of the position
of the satellite pair with state in [0, 2π]2 . When the angular position of one of the satellites hit 0 or
2π, its position has to be reset appropriately. Model that using an action called jump.
(b) The orbit of the satellite pair can be seen as a billiard ball on a [0, 2π] × [0, 2π] table. What
conclusions can you reach from your answer to 1(d) regarding the relative position of satellites?

Problem 4. Hysteresis model (10 + 10 + 5 = 25 points). (a) Model the following hysteresis-based
switching system as a hybrid automaton. The automaton A has (at least) n continuous variables
x1 , . . . , xn and a discrete variable called m that takes the values in the set m1 , . . . , mn . For a state
x of the automaton, we say that the system is in mode mi , if x d m = mi . There are n × (n − 1)
actions switch(i, j), where i, j ∈ [n] and j 6= i. When the system is in mode mi ,

ẋi = ai xi ,

where ai > 0 is a positive constant and ẋj = 0 for all j 6= i. Further, when the system is in mode
mi , for any j 6= i, if xi becomes greater than (1 + h)xj , then the automaton switches to mode
mj ; otherwise, it continues in mode mi . Here, h > 0 is a parameter of the model. Is your model
deterministic?
(b) Write a simulator for this model and plot two executions starting from two different initial
states: one where all the xi ’s are same, and another where they are different. For each execution,
plot the duration that A stays in each mode.
(c) Do you observe something interesting about how long A stays in each mode? Can you conjec-
ture an invariant property of the automaton? No need to prove anything.

Submission. Submit two files: (a) One .pdf with all the written answers, plots, and explanations
for the programs. (b) A .zip file with simulation code and detailed instructions for running them.
If you are submitting an online notebook, then there is no need to submit simulation code. Just
share the link of your online notebook in the .pdf.

You might also like