# Using RegionPlot with NDSolve

So I have a DE which has no analytical solution and thus solved using NDSolve, involving some parameters like this:

solution=NDSolve[{b/z[t]^4+a z'[t]+z''[t]==0,z[0]==3,z'[0]==3},z,{t,0,5}]


I was hoping to use RegionPlot to illustrate the region of a,b which allows the solution to have always positive values over the region:

RegionPlot[FindMinimum[{solution[[1,1,2]][x],0<x<5},{x,2}]>0,{a,-1,1},{b,-1,1}]


However, with some a,b, a singularity would be encountered and that also should be counted as not the correct region. But catching this is tricky. Also, the code above won't work anyway because somehow NDSolve would be evaluated before the values of a and b are inserted, effectively breaking everything. How would I get the correct result?

• What is the definition for f? – Bob Hanlon Jun 22 at 13:24
• @BobHanlon An polynomial of the variables, the actual form doesn't really mattered – t-smart Jun 22 at 13:25
• @t-smart Just give folks something to work with then. It's hard enough trying to help people without having to guess their exact problem! – Chris K Jun 22 at 13:28
• Without some definition the code will not evaluate and we are unable to provide a solution. In which case, look at ParametricNDSolve – Bob Hanlon Jun 22 at 13:28
• @ChrisK edited, thanks – t-smart Jun 22 at 13:29