Variables

$t_n = $ time of nth observation(sec)
$v_n = $ velocity at time $t_n$ (m/s)
$c_n = $ time to make nth adjustment(s)
$a_n = $ acceleration after nth adjustment (n/s^2)
$m_n = $ wait time to (1+n)th adjustment (s)

Assumptions

$\Delta t = t_{n+1}-t_n = c_n+w_n$
$\Delta v = v_{n+1}-v_n = $
$a_n = -kv_n $

$k, c_n, w_n > 0$
$c_n$, $w_n$ are constant = $c$,$w$

Objective

Determine if $v_n \to 0 $

Let $u_1(n)=v_n$ and $u_2(n)=v_{n-1}$ Then it follows that $\Delta v_1 = -kwu_1=kcu_2$ $\Delta v_2 = u_1 - u_2 So, now we must determine the stability of (0,0)

In [6]:
#Initial Values

k =.1
w = 8
c = 5
In [8]:
# System

deltaU1(u1,u2) = -k*w*u1-k*c*u2
deltaU2(u1,u2) = u1-u2
In [11]:
# Vector Field

plot_vector_field((deltaU1,deltaU2),(u1,-5,5),(u2,-5,5))
Out[11]:
In [16]:
u10 = -4
u20 = 0
L = [(u10,u20)]
for i in range(10):
    u1last = L[-1][0]
    u2last = L[-1][-1]
    L.append((u1last+deltaU1(u1last,u2last),u2last+deltaU2(u1last,u2last)))
In [17]:
list_plot(L,color= 'red', plotjoined = True)
Out[17]:
In [18]:
@interactive
  File "<ipython-input-18-bbd2856815f5>", line 1
    @interactive
                ^
SyntaxError: unexpected EOF while parsing