1
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ What is the definition for f? $\endgroup$ – Bob Hanlon Jun 22 at 13:24
  • $\begingroup$ @BobHanlon An polynomial of the variables, the actual form doesn't really mattered $\endgroup$ – t-smart Jun 22 at 13:25
  • 1
    $\begingroup$ @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! $\endgroup$ – Chris K Jun 22 at 13:28
  • $\begingroup$ Without some definition the code will not evaluate and we are unable to provide a solution. In which case, look at ParametricNDSolve $\endgroup$ – Bob Hanlon Jun 22 at 13:28
  • $\begingroup$ @ChrisK edited, thanks $\endgroup$ – t-smart Jun 22 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.