Integrating optimization with thermodynamics and plant physiology for crop ideotype design