A multiport approach to modeling and solving large-scale dynamic systems