Sandy H.S. Herho, Iwan P. Anwar, Faruq Khadami, Theo R.E.B.N Ndruru, Rusmawan Suwarman, Dasapta E. Irawan
Coastal vegetation provides critical wave attenuation for shoreline protection, but existing models are computationally prohibitive or lack educational transparency. We present wave-attenuation-1d, an open-source Python package implementing linearized shallow water equations with vegeta\-tion-induced drag. The model uses fourth-order Runge-Kutta integration on a staggered grid, achieving unconditional stability through implicit treatment of the drag term. Numerical experiments with monochromatic waves through 40-meter vegetation patches demonstrate transmission coefficients from 0.655 (sparse) to 0.010 (dense vegetation), corresponding to 34.5% and 99.0% wave height reductions. While the one-dimensional framework simplifies three-dimensional flows and flexible vegetation dynamics, it provides a computationally efficient baseline for understanding wave-vegetation interactions. The package features standardized NetCDF output and modular architecture, bridging research-grade simulations and accessible educational tools for exploring nature-based coastal protection solutions.