The background is as follows: I consider the following differential equation
$$\phi_{xx}+u\phi=\lambda \phi,\ \ \lambda=-k^2$$
where $u=u(x),\ \phi=\phi(x,\lambda)$, $\lambda$ is the spectral parameter.
I designed a new solving algorithm that can numerically solve the above equation. I want to test the performance of my algorithm, so I hope to generate some random $u$ for testing, but I require these random $u$ to satisfy some conditions, such as tends to $0$ at infinity.
I know that without additional conditions, we can use Gaussian Random Field (GRF) to generate a random function with certain continuity within a certain interval (in numerical form, of course.)
But if I have additional conditions, like the conditions we mentioned above, or conditions that require equal to 0 at the two endpoints $[x_L, x_R]$, what method should I use to generate them?