UnDefVarError - Model not defined in Julia optimization problem

Could you please post the complete error output? You can follow the instructions here: PSA: how to quote code with backticks to quote your code so that it will render properly as well.