This paper presents a case study oftwo approaches for optimal microgrid control. The simulations are based on a real test site located in Sweden. One of the two presented models replicates the actual implemented rule based control(RBC)that is currently realized on the test site. The second model applies a model predictive control (MPC) scheme assuming the same system and boundary conditions. The performance is assessedin terms of maximizing the islanding time, signifying the timethe microgrid(MG)can disconnect from the remaining distribution grid.