@Carl Love

What is the point of using **Grid:-Seq **(or even **seq**) for a sequence of length 1?

This is the only working mode that I found. It's may be strange and not correct, but working.

I've tried without **Grid:-Seq **:

dsol := dsolve(dsys, numeric, parameters = [bb, qq, prf0, `pθf0`], compile = true, optimize = true, output = listprocedure, maxfun = 0):

dsol3 := proc (tt) try dsol[3](tt) catch "cannot evaluate the solution further": tt = 0. end try end proc:

st := time[real]():

A := Array([Grid:-Seq([seq(op(2, [dsol[1](parameters = [b[i, j], q[i, j], pr[i, j], `pθ`[i, j]]), rhs(dsol3(-10^6))]), j = 1 .. sz[2])], i = 1 .. sz[1])]);

time[real]()-st;

but I received a blank Array: []. (This method working correctly with compile=false.)

Then I've tried with **Grid:-Set **:

dsol := dsolve(dsys, numeric, parameters = [bb, qq, prf0, `pθf0`], compile = true, optimize = true, output = listprocedure, maxfun = 0):

**Grid:-Set(dsol);**

dsol3 := proc (tt) try dsol[3](tt) catch "cannot evaluate the solution further": tt = 0. end try end proc:

st := time[real]():

A := Array([Grid:-Seq([seq(op(2, [dsol[1](parameters = [b[i, j], q[i, j], pr[i, j], `pθ`[i, j]]), rhs(dsol3(-10^6))]), j = 1 .. sz[2])], i = 1 .. sz[1])]);

time[real]()-st;

**Grid:-Set **returned an error:

dsol := dsolve(dsys, numeric, parameters = [bb, qq, prf0, `pθf0`], compile = true, optimize = true, output = listprocedure, maxfun = 0);

**Grid:-Set(dsol);**

Error, invalid input: too many and/or wrong type of arguments passed to Grid:-Set; first unused argument is [t = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by ...

However, the method from example.mw works less stable with increasing array size (variable sz) and/or number of nodes, often resulting in error after filling an Array:

Error, (in dsolve/numeric/SC/preproc) unable to post-link (rc=31), please try again, and if that fails check that your Windows SDK installation is up to date, and compatible with your Windows compiler

Do you know correct and stable method of using compiled dsolve with Grid?