  Quantum hydrodynamic theory (QHT) can describe some of the characteristic
features of quantum electron dynamics that appear in metallic nanostructures,
such as spatial nonlocality, electron spill-out, and quantum tunneling.
Furthermore, numerical simulations based on QHT are more efficient than fully
quantum mechanical approaches, as exemplified by time-dependent density
functional theory using a jellium model. However, QHT involves kinetic energy
functionals, the practical implementation of which typically induces
significant numerical instabilities, particularly in nonlinear optical
phenomena. To mitigate this problem, we develop a numerical solution to QHT
that is quite stable, even in a nonlinear regime. The key to our approach is to
rewrite the dynamical equation of QHT using the effective Schr\"odinger
equation. We apply the new method to the linear and nonlinear responses of a
metallic nanoparticle and compare the results with fully quantum mechanical
calculations. The results demonstrate the numerical stability of our method, as
well as the reliability and limitations of QHT.
