NDSolveValue with Map

I have:

f[x_, y_] = 1 - y;
g[x_, y_] = x^2 - y^2;
sol[{x0_, y_ 0}] :=
NDSolveValue[{x'[t] == f[x[t], y[t]], y'[t] == g[x[t], y[t]],
x[0] == x0, y[0] == y0}, {x[t], y[t]}, {t, 0, 15}]


Then:

sol[{2, 1}]


Which returns:

{InterpolatingFunction[{{0., 15.}}, <>][t],
InterpolatingFunction[{{0., 15.}}, <>][t]}


But when I try:

toplot = Map[sol, {{2, 1}}]


It returns:

Notice that there is no comma this time between the first and second interpolating function. Why not?

• There is a comma if I do as you input. However, it seems that you asked for MatrixForm, and the matrix form of a list does not have comma in between elements. Commented Apr 16, 2015 at 0:59
• That is correct. Thanks. Commented Apr 16, 2015 at 3:25

After correcting the typo in the argument to sol ({x0_, y_ 0} to {x0_, y0_}), I cannot reproduce your problem:

\$Version


"10.1.0 for Mac OS X x86 (64-bit) (March 24, 2015)"

f[x_, y_] = 1 - y;
g[x_, y_] = x^2 - y^2;
sol[{x0_, y0_}] :=
NDSolveValue[{x'[t] == f[x[t], y[t]], y'[t] == g[x[t], y[t]], x[0] == x0,
y[0] == y0}, {x[t], y[t]}, {t, 0, 15}]

toplot = Map[sol, {{2, 1}}]


 Plot[toplot, {t, 0, 15}, PlotRange -> All]


• Thanks for the notice. I've discovered it myself this morning. Commented Apr 16, 2015 at 16:46