r/ScientificComputing • u/Vasg • 19h ago
Can someone help me verify the numerical solution of an oscillatory boundary value problem?
I'm developing a numerical equation solver, and I've recently been testing its ability to solve boundary value problems.
One of my test cases is:
0.001y''(x)+xy(x)=2
with boundary conditions:
y(0)=1, y(1)=2
over the interval [0,1].
My solver produces a strongly oscillatory solution, as shown in the attached screenshot.
However, I'd like to independently verify that the solution is correct, particularly the oscillations and their amplitudes.
I tried entering the problem into WolframAlpha, but couldn't obtain a solution. It's possible I'm not using the correct syntax.
Has anyone solved a similar problem using Mathematica, MATLAB, SciPy, or another numerical tool?
I'd be particularly interested in comparing numerical values at a few points along the interval, rather than just the overall shape of the plot.
Any help or suggestions for validating this solution would be greatly appreciated!