0
$\begingroup$

I am trying to graph this imageyield effort curve

using this line of code

Manipulate[ (sol = 
   NDSolve[{y[t] == h[t]*(Ke^(-h[t]/r)), y[0] == 0.001}, 
    y[t], {t, 0, 1000}]; 
  Plot[Evaluate[x[t] /. sol], {t, 0, 1000}, 
   PlotRange -> {0, 10}]), {{r, 0.01}, 0, 0.05}, {{Ke, 5}, 0, 10}]

But my code isn't working. Can you tell me what's wrong? This is the equation that is supposed to model the graph

$$y=hKe^{-\frac{h}{r}}$$

$\endgroup$
6
  • $\begingroup$ What is h[t] and x[t]? and it's not a differential equation. $\endgroup$
    – zhk
    Commented Feb 26, 2018 at 14:14
  • $\begingroup$ that's the harvesting rate with respect to time. x[t] is supposed to be y[t] $\endgroup$ Commented Feb 26, 2018 at 14:15
  • $\begingroup$ oh sorry I mean just equation $\endgroup$ Commented Feb 26, 2018 at 14:18
  • $\begingroup$ Is there any expression for h[t]? $\endgroup$
    – zhk
    Commented Feb 26, 2018 at 14:19
  • $\begingroup$ Now that I think about it, if it's just a regular equation there is no need for it to be dependent on time so we can just remove the "of t" altogether $\endgroup$ Commented Feb 26, 2018 at 14:23

1 Answer 1

2
$\begingroup$

You gave the equation at the end. Just plot it:

Manipulate[
 Plot[h*k*Exp[-h/r], {h, 1, 1000}, PlotRange -> All],
 {{k, 50}, 10, 100},
 {{r, 50}, 10, 100}
 ]

Mathematica graphics

$\endgroup$

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