The Almgren Chris model from Optimal Execution of Portfolio Transactions is the most well known optimal execution model and provides the foundational math about how to think about trading some quantity of an asset. This blog post goes through the math and how we set the problem up and arrived at the various solutions.