Generalized plane strain analysis of solenoid magnets