我试图利用综合指挥在几个循环封闭道路上找到复杂的线/构件。 我关于第1/(z-i)^2圈子({z : > ><2}穿透器)的代码一度为:
fun = @(z) 1 ./((z-1i) .^ 2);;
g = @(t) 2 .*(cos(t) + 1i .* sin(t));
gprime = @(t) 2 .*(-sin(t) + 1i .* cos(t));
q1 = integral(@(t) fun(g(t)) .* gprime(t),0,2 .* pi)
(我预计答案为0,matlab提供6.6613*10^(-16)-4.4409*10^(-16)i)。
My code for the integral of e^z/(z(z^2-9)) over the circle {z:|z-2|=3} traversed once anticlockwise is as follows:
fun = @(z) exp(z) ./(z .* (z.^2-9));
g = @(t) 2+3 .*(cos(t) + 1i .* sin(t));
gprime = @(t) 2+3 .*(-sin(t) + 1i .* cos(t));
q1 = integral(@(t) fun(g(t)) .* gprime(t),0,2 .* pi)
(我预计答案为pi/9(e^3-2)i,但书记处提供5.431+6.3130i)。
As can be seen above, my problem is that while the code gives accurate values when the circular path is centred at the origin, it fails otherwise; sometimes giving an accurate imaginary part but inaccurate real part or just a completely inaccurate answer.
Can anyone see what is going wrong?