Considering inputs:
vti={0, 1.5, 2.4, 5.0675, 7.735, 10};
Vscc=1.5; PSA=0.025; f=0.6; m=10;
I defined a function "pwtemp2", using "FC1" and "FC2":
FC1[t_] := Count[vti, x_ /; (t - Vscc) \[LessSlantEqual] x < t];
FC2[t_] := Count[vti, x_ /; (t - f Vscc) \[LessSlantEqual] x < t];
pwtemp2[t_] :=
Piecewise[{{PSA^FC1[t],
Vscc \[LessSlantEqual] t < 2 Vscc}, {PSA^FC2[t],
2 Vscc \[LessSlantEqual] t < m}}];
When I Plot pwtemp2, its OK:
Plot[pwtemp2[t], {t, 0, m}, PlotRange -> Full, Filling -> Axis,
PlotTheme -> "Detailed"]
I also have this Piecewise function pwtemp1 (its big, but here could be any simple Piecewise, not defined as a pattern function):
pwtemp1=Piecewise[{{Piecewise[{{1.04819277 - E^(-0.03150354*(-1.5 + t)),
Inequality[0, LessEqual, -1.5 + t, Less, 1.5]},
{1.002358723234263 - E^(-0.03150354*(-3. + t)),
Inequality[1.5, LessEqual, -1.5 + t, Less, 2.4]},
{1.000757843243746 - E^(-0.03150354*(-3.9 + t)),
Inequality[2.4, LessEqual, -1.5 + t, Less, 5.0675]},
{1.0020339850944202 - E^(-0.03150354*(-6.5675 + t)),
Inequality[5.0675, LessEqual, -1.5 + t, Less,
7.734999999999999]}, {1.002065888640687 -
E^(-0.03150354*(-9.235 + t)),
Inequality[7.734999999999999,
LessEqual, -1.5 + t, Less, 10]}}, 0],
Inequality[1.5, LessEqual, t, Less, 3.]},
{Piecewise[{{1.04819277 - E^(-0.03150354*(-0.8999999999999999 +
t)),
Inequality[0, LessEqual, -0.8999999999999999 + t,
Less, 1.5]}, {1.002358723234263 -
E^(-0.03150354*(-2.4 + t)),
Inequality[1.5, LessEqual, -0.8999999999999999 + t, Less,
2.4]}, {1.000757843243746 - E^(-0.03150354*(-3.3 + t)),
Inequality[2.4, LessEqual, -0.8999999999999999 + t, Less,
5.0675]}, {1.0020339850944202 -
E^(-0.03150354*(-5.967499999999999 + t)),
Inequality[5.0675, LessEqual, -0.8999999999999999 + t, Less,
7.734999999999999]}, {1.002065888640687 -
E^(-0.03150354*(-8.635 + t)),
Inequality[7.734999999999999,
LessEqual, -0.8999999999999999 + t, Less, 10]}}, 0],
Inequality[3., LessEqual, t, Less, 10]}}, 0]
When I Plot pwtemp1, its OK:
Plot[pwtemp1, {t, 0, m}, PlotRange -> Full, Filling -> Axis, PlotTheme -> "Detailed"]
NOW, the core point! I simple need to calculate the Integral of the multiplication of "pwtemp1" and "pwtemp2". Both pwtemp1 and pwtemp2 are somehow in function of "t", however, pwtemp2 is explicity defined as "pwtemp2[t_]:=" in order to make possible the recursive evaluation of FC1 and FC2. pwtemp1 is a Piecewise function, and inside of it, also have the variable "t". But, when I try:
NIntegrate[pwtemp1 pwtemp2[t], {t, 0, m}]/m
0.0372106
It returns a WRONG value, that represents only the Integral of pwtemp1. To confirm, when I evaluate as below, returns the same result! WHY?
NIntegrate[pwtemp1, {t, 0, m}]/m
0.0372106
And the weird is that when I Plot the same expression that I tried to calculate the Integral, the Plot returns the correct graph. Note that 0.0372106 could not be the Integral result (divided by m=10 to get the Average), as far as visually the Integral result should be less that that.
Plot[pwtemp1 pwtemp2[t], {t, 0, m}, PlotRange -> Full,
Filling -> Axis, PlotTheme -> "Detailed"]