What is the size of R_, which has been extracted from the monitor T? You can use the size script command to do this. Are you recording this data at multiple frequency points? The in-built PSO algorithm in FDTD can only optimize a single-valued figure of merit. This issue might arise if R_ is an array/matrix. Please let me know if this doesn't work. Thank you!