0

I am trying to solve a nonlinear and discontinuous fourth order BVP using the solve_bvp function of SciPy. My equation is $y^{(4)}=cf(y)$, where $f(y)$ is a nonlinear function. This equation is solved in the domain $x\in(0,1)$, and $f(y)=0$ when $x>0.5$. Given the nature of the equation, it is proving out to be difficult to solve using MATLAB or Python. MATLAB gives results which are way off, so I went to python, and scipy is actually able to give results which are expected, albeit with a warning that maximum nodes exceeded. The sol.status is 1 and residuals high near the discontinuity point $x=0.5$. My question is, does the fact that there is a warning completely rubbishes any solution that I get, howsoever 'expected' it may be?

whpowell96
  • 2,444
  • 7
  • 19
  • Usually yes. You can set max_nodes to something higher than the default value or you can find a better initial guess of the solution. The high-order collocation method used in solve_bvp expects that the ODE is sufficiently smooth so that the error estimation is meaningful. This is invalid in a small or big way if the lower order-derivatives have jumps. // Did you mean it like you wrote, that $f(y)$ also depends explicitly and directly on $x$, or is $f(y)=0$ for $y>0.5$? – Lutz Lehmann Jul 09 '23 at 05:28
  • Yes I meant how I wrote, that in half of the domain $x>0.5$, I have a homogeneous equation. And in the other half, I have a nonlinear RHS. It is interesting to note that when f(y) is linear, an analytical solution is possible, and in that case the solve_bvp solution converged to that, despite the discontinuity – Mechanician Jul 09 '23 at 11:50
  • If I understand this correctly, then because of this discontinuity the error estimate is itself invalid, and that should mean that the solution may be correct, even though the software shows failure to converge within a tolerance? If not, any other ways to handle this sort of equation? – Mechanician Jul 09 '23 at 12:06

0 Answers0