A substructure approach to power flow analysis and application to engineering structures