The practical problem which this proposal addresses is how to manage the UK energy system in a future where there will be much more use of unpredictable energy sources (wind, solar) and also of inflexible energy sources (biomass, tidal, nuclear, geothermal). Wind power is highly unpredictable - effectively a random walk over lead times up to 12 hours - and the total UK output of wind power can vary unpredictably by 25% over four hours. This is the capacity of several large thermal generators, but it also takes four hours to warm up such a generator.With the government's planned extensive use of wind, for the first time ever the UK's available supply of power over the next four hours will be less predictable than the demand for it. There will be large continuous uncertainty in real time, and it is unlikely that gas generators (which will be a smaller part of the total system) can ramp fast enough to compensate for any shortfalls. Otherwise the system must use some mix of: fast-ramping but inefficient gas generators; energy storage by producers and users, and perhaps more frequent power outages, and/or wastage of temporary power surpluses.The energy industry has no standard mathematical tools for even addressing this problem. Conventional models for scheduling and storage make little allowance for uncertainty, and they tend to simplify the problem to large discrete chunks of capacity and time, in steps from one to six hours, and they also omit many engineering constraints. The fall-back tool for modelling in greater detail is simulation, but our work has shown that this gives a coarse approximation, which is unacceptably slow to compute. What is needed are mathematical models which assume continuous time uncertainty, can implement complex engineering and other constraints, and generate optimal decisions in that environment.Financial mathematics has a ready-made tool kit for modelling optimal decisions about stochastic physical systems, if we simply reverse the role of the random walk variable, from modelling a price to modelling a physical quantity. This opens a huge arsenal of tools for treating mixed deterministic and stochastic physical systems under complex constraints. The methods are as flexible as the related (partial differential) equations used to model deterministic systems in physical engineering, but this new approach turns out to be one billion times faster than corresponding simulation computations. For three years we have explored this new approach with promising results, but we have so far accepted a constraint that our models can be either complex and stochastic in price behaviour, but simple in physical behaviour (as in finance, where the most complex physical decision tends to be the binary one of buying or not buying a share) or complex and stochastic in physical behaviour, but simple in price behaviour (as in our early models, where complex flows take place into and out of a storage system, but with a deterministic price structure for fuel, which is realistic if gas has been bought on a long term contract).This proposal aims to build models in which there are complex real time disturbances to both prices and physical rates. This breaks new mathematical modelling ground, and also opens a wider class of economic applications. For example because electricity is widely traded, such models might offer a unified framework for optimal decisions on how to operate a physical electricity or storage plant, how and when to sell its output forward, and when to trade in the market without intending to deliver electricity. Finally, since the models assume a richer continuous time framework than most existing trading or engineering systems permit, the models may suggest directions for improving the working and efficiency of markets, and the physical design and evolution of electricity plants and systems.