# 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 == 1.42372*Rau, r1' == 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]


## marked as duplicate by xzczd differential-equations StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 29 '18 at 9:24

• 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
• 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