I have next code
a = 1;
T = 25;
Subscript[I, 1] = If[t < T, a*t, 2*a*T - a*t];
Plot[Subscript[I, 1], {t, 0, 2 T}, AxesLabel -> {t, I1}]
I need to find average current on some interval, for this I do next
t1 = 1;
t2 = 5;
f = 1;
b = Table[If[i <= T, a*i, 2*a*T - a*t], {i, t1, t2, f}]
Subscript[I1, average] = Total[b]/Length[b]
It calculates average current correctly only to 25 value, after that all values are not correct. This error occurs because i don't include 25 value in false condition. How can I fix it? And How can I to get result in List form?