Numerical differentiation of complex valued function

279 Views Asked by At

I am trying to find the derivative $\frac{dy}{dx}$ from the following dataset,

x y =============================== 0 0.37646 + 0i 10 0.37074 + 0.065372i 20 0.35376 + 0.12876i 30 0.32603 + 0.18823i 40 0.28839 + 0.24198i 50 0.24198 + 0.28839i 60 0.18823 + 0.32603i 70 0.12876 + 0.35376i 80 0.065372 + 0.37074i 90 0 + 0.37646i 100 -0.065372 + 0.37074i 110 -0.12876 + 0.35376i 120 -0.18823 + 0.32603i 130 -0.24198 + 0.28839i 140 -0.28839 + 0.24198i 150 -0.32603 + 0.18823i 160 -0.35376 + 0.12876i 170 -0.37074 + 0.065372i 180 -0.37646 + 0i

where $y = y(x)$ is complex valued function.

The exact solution of the derivative is shown below

x dy/dx (exact) =============================== 0 0.082825 + 0i 10 0.078016 + 0.028003i 20 0.064084 + 0.052865i 30 0.042495 + 0.071717i 40 0.015602 + 0.08225i 50 -0.013527 + 0.083005i 60 -0.041391 + 0.073629i 70 -0.064467 + 0.05504i 80 -0.079708 + 0.029423i 90 -0.085034 + 5.2068e-18i 100 -0.079708 - 0.029423i 110 -0.064467 - 0.05504i 120 -0.041391 - 0.073629i 130 -0.013527 - 0.083005i 140 0.015602 - 0.08225i 150 0.042495 - 0.071717i 160 0.064084 - 0.052865i 170 0.078016 - 0.028003i 180 0.082825 - 1.0143e-17i

Can someone help me match the numerical derivative to the exact solution?