Dynamic Interactions between Local Energy Systems Coupled by Power and Gas Distribution Networks