I have the following code
Clear[AdomTrunctest, AdomPolyNtest, ListPolytest, y];
AdomTrunctest = 3;
ExDtest := Sum[D[y[n, t], t], {n, 0, AdomTrunctest}];
Ntest = Expand[(y'[t])^2 /. y'[t] -> ExDtest ];
ListPolytest =
Reverse[MonomialList[
Ntest /. y[x_, z_] -> EPS^x*y[x, z] /.
Derivative[A_, B_][y][x_, z_] ->
EPS^x*Derivative[A, B][y][x, z], EPS]] /. EPS -> 1;
For[i = 0, i < AdomTrunctest + 1, i++,
AdomPolyNtest[i] = ListPolytest[[i + 1]]]
For[i = 0, i < AdomTrunctest + 1, i++,
Print["A", i, " = ", AdomPolyNtest[i]]]
y[0, t_] = 1 + 2 t
Print["A", 0, " = ", AdomPolyNtest[0]]
My issue is with the last few lines, if you run this code you will see the third last line prints the general form of the so called polynomials I am calculating, everything is good. However once I define y[0, t_] = 1 + 2 t
in the second to last line, I expect now that once I call AdomPolyNtest[0]
in the last line, that the derivative of y[0,t]
be evaluated, and not left general, but it is instead left general. I believe this is because I have replaced ExDtest
which was SetDelayed
with Derivative
within the MonomialList
command, so it is no longer "evaluated afresh" each time it is called.