I define:
f[x_] := Piecewise[{{5, 0 <= x < 10}, {g[x], 10 <= x < 15}, {h[x], x > 15}}]
Then I try to solve ODE:
a = 0.7
NDSolve[{g'[x] == Sin[x] + 2*With[{t = a*x}, Refine[f[t], 0 <= t < 10]], g[10] == 5},
g[x], {x, 10, 14.2857}]
It gives $g[x]$ as InterpolatingFunction.
Then - plot it:
Plot[f[x], {x, 0, 11}]
But it plots $f[x]$ only in {x, 0, 10}, where the function is defined manually. So, plotting $g[x]$ also doesn't give any result. I tried other definitions of Piecewise function (such as $f$), but it also didn't work. Solving ODE for $f[x]$ (not for $g[x]$) is helpless.
So, my question is: Can I use different undefined parts of Piecewise function for calculations? If not, are there another possibilities to do this in Mathematica maybe?