Understanding and improving tandem solar cells and modeling agrivoltaics array performance