I am trying to merge two NDSolve solutions (solutions of the same problem on a partitioned region). Even though my code does the job, it does it with errors. I was wondering if there are other efficient methods of achieving the same goal.
s1 = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 15}];
s2 =
NDSolve[
{y'[x] == y[x] Cos[x + y[x]], y[15] == 0.1546793160063605`},
y, {x, 15, 30}];
ss[x_] := Piecewise[{{s1, x <= 15}, {s2, x >= 15}}];
Plot[Evaluate[y[x] /. ss[x]], {x, 0, 30}, PlotRange -> All]




{{y->InterpolatingFunction[<<5>>]}} x>=15 0 True } is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.```– Oluwaseun Sharomi Dec 18 '20 at 05:43