Hello,
I am trying to use the interpolating function generated by NDSolve to calculate the time at which the function reaches a value of 1. I tried the following code:
q = 3/100
c = 1/2
b = d = 1
k = G = 20000
g = 1
slv = NDSolve[{x'[t] == x[t]*b*h[t]/G - x[t]*d*x[t]/k,
y'[t] ==
y[t]*b*(1 - c*g)*h[t]/G + y[t]*b*(1 - c*g)*g*(1 - h[t]/G) -
y[t]*d*(x[t])/k, h'[t] == -q*h[t], x[0] == k, y[0] == 1,
h[0] == G}, {x, y, h}, {t, 0, 1000}]
FindRoot[x[t] /. slv == 1, {t, 0}]
But receive the following error:
FindRoot::nlnum: The function value {-1.+x[0.]} is not a list of numbers with dimensions {1} at {t} = {0.}.
Any help would be greatly appreciated!
Thank you,
Alex
Attachments: