Problem 2 (d)
Matlab code:
Place those three functions as separate m -files in the same folder
function dy = hardening(t,y)
dy = zeros(2,1);
dy(1) = y(2);
dy(2) = -y(1)*(1+y(1)^2);
function dy = softening(t,y)
dy = zeros(2,1);
dy(1) = y(2);
dy(2) = -y(1)*
(d)
Compute eigenvalues and corresponding eigenvectors, if you use Matlab or Mathematica,
use eig(A) to compute right eigenvectors, and eig(A) to compute left eigenvectors.
Dene V to be the right eigenvector matrix and W to be the left eigenvector matrix,
3(a) Use the fact that
xk+1 = A xk
V (xk ) = xT P xk
k
we can get
V (xk+1 ) V (xk ) = xT+1 P xk+1 xT P xk
k
k
= xT (AT P A P ) xk
k
= xT Q xk
k
So the algebraic Lyapunov equation for discrete-time system is
AT P A P = Q
(b) We propose a solution
(Ak )T Q