There are three subtle problems with how you define your function ff
. The first is that you collect the arguments in a list {c1...}. Consider the two following functions:
f[x_, y_, z_] := x^2 + y z;
g[{x_, y_, z_}] := x^2 + y z;
The two functions achieve the same goal, but the input is packaged in two different ways. The function f
is a function of THREE variables, one in each slot. The function g
is a function of ONE vector variable. The mechanism of Derivative
relies on the counting of slots, so that it only applies to f
, not to g
. Try to calculate the derivative with respect to y
:
Derivative[0, 1, 0][f][x, y, z]
Derivative[0, 1, 0][g][{x, y, z}]
The second problem is that you define ff
only for NUMERIC values of the variables ff[{c1_Real, c2_Real...
This makes it impossible to calculate the derivatives, because calculating a derivative involves the function calculated on a SYMBOLIC input.
The third problem is that your ff
depends on 13 variables, while your derivative operator nder[n, 12, ff]
assumes 12 variables.
The following code runs without errors:
sig = 1/10; teq = 1;
cout0 = Table[If[i <= 4, 1, 1/16], {i, 1, 6}];
nder[n_, m_, f_] := (Derivative @@ UnitVector[m, n])[f];
ccvar = Table[cc[i][t], {i, 6}];
ff[c1_, c2_, c3_, c4_, alpha11_, alpha21_, alpha31_, alpha41_,
alpha12_, alpha22_, alpha32_, alpha42_, alpha13_] = 1;
eqnlist = Flatten[Table[{Derivative[1][cc[n]][t] == sig*
nder[n, 13, ff][Sequence @@ Flatten[{ccvar, ccvar}]],
cc[n][0] == cout0[[n]]},
{n, 6}]];
solDEsuper = NDSolve[eqnlist, ccvar,
{t, 0, teq}]