We present a framework for the design and simulation of electrical distribution systems and short term electricity markets specific to the UK. The modelling comprises packages relating to the technical and economic features of the electrical grid. The first package models the medium/low distribution networks with elements such as transformers, voltage regulators, distributed generators, composite loads, distribution lines and cables. This model forms the basis for elementary analysis such as load flow and short circuit calculations and also enables the investigation of effects of integrating distributed resources, voltage regulation, resource scheduling and the like. The second part of the modelling exercise relates to the UK short term electricity market with specific features such as balancing mechanism and bid-offer strategies. The framework is used for investigating methods of voltage regulation using multiple control technologies, to demonstrate the effects of high penetration of wind power on balancing prices and finally use these prices towards achieving demand response through aggregated prosumers.