Static Optimization: draft
get around the memory issue in MATLAB