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.}.
That shows me that x[t] will not equal 1 anywhere in the range of 0..1000. Outside that range it is going to have to extrapolate and any result will be far more questionable. Does this give you any idea where to begin looking for the reasons this has happened?
Note, to be really honest, the first plot I did included x[t],y[t] and h[t] from 0..1000. You might peek at that graph.