Wednesday, December 29, 2010

Dynamic optimization in Excel?

I've been strugglig to solve a rather complex optimization problem lately. The equality constraints are defined partly as nonlinear differential equations, partly as algebraic equations of those time-varying variables solved for by the ODEs, and a bunch of inequality constraints. The degrees of freedom are functions of time. This is a so-called dynamic optimization problem. These problems are defined as follows;




Normally, you would solve these problems either using expensive software tailored to the purpose, or by discretizing the input u and using advanced optimization software to solve the resulting large nonlinear programming problem. This was tried, with the venerable l_bfgs_u algorithm available in SciPy. Well - it was slow and not very robust.

Excel to the rescue! The model was implemented using forward Euler with very short step length, resulting in an Excel model with 150.000 linked cells. The objective function was a quadratic function with 24000 terms. And the Excel solver was actually capable of handling this! Incredible!

That being said - this was solved using Excel 2004 for Mac. It seems the solver in this edition has not been completely stripped down, forcing you to buy the "professional" license from Frontline. Or maybe I am wrong on that - it did work to solve my problem.

No comments:

Post a Comment