As shown by bbgodfreybbgodfrey
, NIntegrate
can solve your problem, but I just want to add, Integrate
can actually handle InterpolatingFunction
:
int[t_] = Integrate[y1[t] /. S1, t]
The output is an InterpolatingFunction
representing the definite integral of $y_1(t)$ over $[0,t]$. The advantage of this approach is, you don't need to integrate again and again if you want to know the integral at other points. Just compare the following:
Table[int@t, {t, 0, 100, 1/10}]; // AbsoluteTiming
(* {0.015558, Null} *)
int2[tt_] := NIntegrate[y1[t] /. S1, {t, 0, tt}]
Table[int2@t, {t, 0, 100, 1/10}]; // AbsoluteTiming
(* {2.340323, Null} *)
Then
同学,如果你现在所获得的两个答案中的某一个真的帮到了你的话,你完全可以点一下你所满意的答案旁边的小勾(也就是上面那条评论里所说的Click the checkmark sign)来把它采纳(accept)了的。