0
$\begingroup$

I try to draw a graph:


     ClearAll[k, r, n]
    k = 20
    r = .8

    Manipulate[
     psol = DSolve[{p'[t] == r*p[t] (1 - p[t]/k), p[0] == n}, p[t], t];
     Plot[ psol[t] , {t, -10, 10} ], {n, 0, 1}]

but I get an error:

Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.

$\endgroup$

1 Answer 1

1
$\begingroup$

The message is warning that inverse functions are being used by Solve, so some solutions may not be found

You can ignore it if you want

ClearAll[k, r, n]
k = 20
r = .8
Manipulate[
 psol=Quiet[DSolve[{p'[t]==r*p[t] (1-p[t]/k),p[0]==n},p[t],t]];
 Plot[p[t]/.psol,{t,-10,10}],
 {{n,0,"n"},0,1,Appearance->"Labeled"}
]

Or it might be better to turn off that one messaage

Manipulate[
  psol=DSolve[{p'[t]==r*p[t] (1-p[t]/k),p[0]==n},p[t],t];
  Plot[p[t]/.psol,{t,-10,10}],{{n,0,"n"},0,1,Appearance->"Labeled"}
,Initialization:>
{
  k=20;
  r=.8;
  Off[Solve::ifun]
}
]

enter image description here

see ref/message/Solve/ifun for more information on this message

Mathematica graphics

$\endgroup$
3
  • $\begingroup$ You can still use Quiet[] to turn off a single message locally: Quiet[Solve[y == x Exp[x], x], Solve::ifun]. $\endgroup$ Commented Nov 5, 2017 at 20:57
  • $\begingroup$ If plotting the solution is the only goal, you could just use NDSolve. $\endgroup$ Commented Nov 6, 2017 at 10:22
  • $\begingroup$ Rather than repeatedly evaluating DSolve, move that to the Initialization: Manipulate[ Plot[sol[n, t], {t, -10, 10}, PlotRange -> {0, 20}], {{n, 0}, 0, 1, 0.01, Appearance -> "Labeled"}, Initialization :> {k = 20; r = 4/5; sol[n_, t_] = p[t] /. DSolve[{p'[t] == r*p[t] (1 - p[t]/k), p[0] == n}, p, t][[1]] // Quiet}] $\endgroup$
    – Bob Hanlon
    Commented Dec 5, 2017 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.