This article develops a linear programming cost minimisation model for the high level system design and corresponding unit commitment of generators and storage within a microgrid; a set of energy resources working co-operatively to create a cost effective, reliable and environmentally friendly energy provision system. Previous work in this area is used as a basis for formulation of a new approach to this problem, with particular emphasis on why a microgrid is different to centralised generation or other grid-connected decentralised energy resources. Specifically, the model explicitly defines the amount of time that the microgrid would be expected to operate autonomously, and restricts flow of heat between microgrid participants to defined cases. The model developed is applied to a set of United Kingdom commercial load profiles, under best current estimates of energy prices and technology capital costs, to determine investment attractiveness of the microgrid. Sensitivity analysis of results to variations in energy prices is performed. The results broadly indicate that a microgrid can offer an economic proposition, although it is necessarily slightly more expensive than regular grid-connected decentralised generation. The analysis results have raised important questions regarding a fair method for settlement between microgrid participants, and game theory has been identified as a suitable tool to analyse aspects of this situation.