Electrical and Optical Modeling of 4H-SiC Avalanche Photodiodes