I'm working with the function NDSolve. I give it the time of integration, the time I want it to evaluate my differential equations. Sometimes, it crashes before the end of its attribuated time ; For example, I want to evaluate between 0 and 2000 seconds, but for a reason, it crashed at 1877.99325.... or something.
The fact that it crashed or stopped because a predicted event happened doesn't interest me here. I would like to know if there is a way to extract that time and put it in a variable, like that :
NDSolve[...]
(*output of NDSolve*){{f1[x]->InterpolatingFunction[{{0.,1877.99325 (*it's this value that I want !*)}},<>][x],f2[x]->InterpolatingFunction[{{0.,1877.99325 (*it's this value that I want !*)}},<>][x]}}
t=a way or an other to extract my value
timecrash=t
How could I do that ? Any help would be great !
EDIT : ... OK, so my answer was deleted and transformed as a comment, and now I can't comment my own answer (which was supposed to be a comment, by the way). But I can't comment the first comments neither because I still need 50 rep (..??) I tried the "Domain" solution, but it doesn't work so far. I tried these lines :
f["Domain"]/.sol(*this "sol" comes from sol=NDSolve[...]*)//Last
The output is : f[Domain] Another shot : f["Domain"]//Last The output is : Domain
fbe any one of yourInterpolatingFunction[]s, tryf["Domain"] // Last. – J. M.'s missing motivation Jul 09 '15 at 14:19NDSolve[]to something? – J. M.'s missing motivation Jul 09 '15 at 17:54NDSolve[]so potential helpers can try things out for themselves. – J. M.'s missing motivation Jul 09 '15 at 19:59NDSolve[eqns, {f, g}, {x,...}]for this and other reasons. Otherwise something likef[x] /. sol /. x -> "Domain"would probably work. Glad you solved it. (Including such details as you mentioned in you comment about the actual call toNDSolvewould have helped others to give you more precise and helpful advice earlier. That's why people often ask for the code.) – Michael E2 Jul 10 '15 at 16:06