Question: Using the solution to dsolve (numeric) in a subsequent integral

Hi. I have solved numerical an ODE and want to use the solution in the integrand of a subsequent integral. I'm being frustrated by my lack of knowledge and the internet isn't helping! I hope someone can put me right.....here's the relevant part of code.


dsysA := {diff(r(s), s) = sqrt((g*r(s) + h)^2 - 1 + 1/r(s)), r(0) = rinit};
dsnA := dsolve(dsysA, numeric, abserr = 10^(-6));

dsnA(0.1);
               [s = 0.1, r(s) = 1.51303353884965]

rA := s -> rhs(dsnA(s)[2]):

rA(0.2);
                        1.53235325247661

tA := s -> tinit + int((g*rA(p) + h)/(1 - 1/rA(p)), p = 0 .. s):


tA(0.01);
Error, (in rA) invalid input: rhs received dsnA(p)[2], which is not valid for its 1st argument, expr
 

Please Wait...