I'm rather new to Mathematica so I would greatly appreciate any help. I want to find the series expansion coefficients of iterations of a function and export them as a .csv. Here is what I have written so far:
f[x_] := Sin[x]
iterations = 10;
myOrder=11;
Coeff=ConstantArray[0,{iterations,myOrder}];
For[i=0,i<iterations,i++,
For[j=0,j<myOrder,j++,
Coeff[[i,j]]=Coefficient[Normal[Series[Nest[f,x,i],{x,j,j+1}]],x,j]]]
Export["Coefficient.csv",Coeff];
When I run this, I receive the following errors after the for loops:
Set::partd1: Depth of object Coeff[[i,j]] is not sufficient for the given part specification.
General::stop: Further output of Set::partd1 will be suppressed during this calculation.
Is there an easier way to make what I am trying to make? I'm sure i and j are in bounds in terms of the depth of the array (I have enough array elements to satisfy the for loops).
Thank you for your help.