This lecture covers the modeling of a small open economy where the representative agent maximizes lifetime utility subject to budget constraints and stochastic productivity shocks. Topics include Lagrangian formulation, first-order conditions, borrowing constraints, steady-state analysis, and impulse response plotting. The lecture also explores the effects of relaxing borrowing constraints on capital stock, output, debt, and consumption. MATLAB is used to code the model and analyze the responses to productivity shocks.