Create mastercode_optimization_kv

KV model optimization using patternsearch and fmincon