Sparse semidefinite programming relaxations for large scale polynomial optimization and their applications to differential equations