Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Needs["DifferentialEquations`InterpolatingFunctionAnatomy`"];
- Clear[sol]
- sol = NDSolve[{y'[x] == -0.2 y[x], y[0] == 10}, y, {x, 0, 100},
- Method -> {"EventLocator", "Event" -> y[x] - 1 == 0}];
- end = Max[InterpolatingFunctionDomain[First[y /. sol]][[1]]]
- sol = NDSolve[{x'[t] == a*x[t] - c*x[t]*y[t], x[0] == 10,
- y'[t] == -b*y[t] + d*x[t]*y[t], y[0] == 10}, {x[t], y[t]}, {t, 0,
- tend}, Method -> {"EventLocator", "Event" -> y[t] - 1 == 0}];
- end = InterpolatingFunctionDomain[y /. First[sol]]
- InterpolatingFunctionDomain[y]
Add Comment
Please, Sign In to add comment