# How to find x for certain y from InterpolatingFunction [duplicate]

As shown in the picture, I get the data after using NDSolve. Now I want to get the x for cetain y, how can I do this?

The last three lines is the way I try to find x.

The code:

MH = 1.6726231*10^-27  / 2     ;
c = 3*10^8;
Rau = 0.0529*10^(-9)  ;
Eau = 27.2114*1.6*10^(-19);

Ha1 = 0.10058   ; Hs1 = 0.69856  ; Hxc1 = 2.06479 ;    HD0 = -0.07879;
Ha2 = 1.00145  ;  Hs2 = 2.40274    ; Hxc2 = 1.02858;
Ha3 = -1.02324  ; Hs3 = 2.40624  ; Hxc3 = 1.01416;
E1[r_] :=
Eau*(Ha1*(1 - E^(-Hs1*(r - Hxc1)))^2 + HD0 +
Ha2*(1 - E^(-Hs2*(r - Hxc2)))^2 +
Ha3*(1 - E^(-Hs3*(r - Hxc3)))^2)
F1[r_] = D[-E1[r/Rau], r]       ;

Net21 = NDSolve[{MH *r1''[t]*1/Sqrt[
1 - (r1'[t])^2/
c^2]*(1 + (r1'[t])^2/c^2*(1 - (r1'[t])^2/c^2)^-1) == F1[r1[t]],
r1[0] == 1.42372*Rau, r1'[0] == Sqrt[2*(2.60457*10^-20)/MH]},
r1, {t, 0, 2.*10^(-14)}];

sol = r1 /. First@Net21;
InverseFunction[sol][1.2*10^-10]
FindRoot[sol[t] == 1.2*10^-10, t]

• I have already used the Inversefunction and Findroot, but it did't word – John Tu Oct 29 '18 at 5:21
• How did you use InverseFunction and FindRoot? Please show us the complete code sample. (Note: don't use screenshot, show us the code text. ) – xzczd Oct 29 '18 at 6:37
• I have already done that. Thanks for reminding~ – John Tu Oct 29 '18 at 8:47
• As to the reason why your attempt fails: 1. The power of InverseFunction is limited. 2. Your syntax for FindRoot is incorrect, check the document of FindRoot for more information. – xzczd Oct 29 '18 at 9:29
• I have some ideas. Thank u very much ! – John Tu Oct 29 '18 at 11:24