Circuit-based Modeling and Inverse Design of Metastructures