Quantum algorithms for computing observables of nonlinear partial differential equations