How is dux at Rangitoto College calculated?

How is it calculated and how can I be more competitive?