Operation and planning of coordinated natural gas and electricity infrastructures