So i understand now that I need to add the X(n-1) value at the end for the 3D optimization to count the correct number of etches. But could you please explain how to properly format the .json file for the initial parameters as per the picture above, im not sure what the size (n) value should be here, (with 11 etches the file will have 23 entries after i add the X_n-1) term. This was my attempt at the code but it does not seem to be working when the function is run:
the calls this file via the following script
and when i run it i get the following error

thanks in advance, im sure its something small I am missing/doing wrong