--------------- # Aufgabe 1 # --------------- n = 100000 phi = seq(from=0,to=2*pi,length=n) # 1a) z0 = 1 r = 1 z = z0 + r*exp(1i*phi) dz = diff(z) z = z[-1] fz = 1/( (z-1)^2 * (z^2+4) ) intf = sum( fz*dz ) intf # -0.0000158-0.5026548i -4*pi*1i/25 # 0-0.5026548i # 1b) z0 = 0 r = 4 z = z0 + r*exp(1i*phi) dz = diff(z) z = z[-1] fz = 1/( (z-1)^2 * (z^2+4) ) intf = sum( fz*dz ) intf # 4.5121e-20 - 5.481574e-18i # exact result: 0, das passt. --------------- # Aufgabe 2 # --------------- n = 100000 xmax = 100 x = seq(from=-xmax,to=xmax,length=n) dx = diff(x) x = x[-1] # 2a) fx = 1/(1+x^2)^2 intf = sum( fx*dx ) intf # 1.570796 pi/2 # 1.570796 # 2b) fx = 1/(1+x^4) intf = sum( fx*dx ) intf # 2.221441 pi/sqrt(2) # 2.221441 --------------- # Aufgabe 4 # --------------- # Im Inneren von C_epsilon(0) darf sich nur # die Polstelle bei z=0 befinden, keine # anderen Pole wie z=-1 oder z=pi. Wir # waehlen eps = 0.1 n = 100000 phi = seq(from=0,to=2*pi,length=n) z = eps*exp(1i*phi) dz = diff(z) z = z[-1] fa = cos(z)/z^3 fb = (z^2+4*z+5)/(z^2+z) fc = exp(z)/z^2 fd = (exp(2*z)-1)/(sin(z))^2 Res_a = 1/(2*pi*1i)*sum( fa*dz ) Res_b = 1/(2*pi*1i)*sum( fb*dz ) Res_c = 1/(2*pi*1i)*sum( fc*dz ) Res_d = 1/(2*pi*1i)*sum( fd*dz ) Res_a # exact: -0.5 Res_b # exact: 5 Res_c # exact: 1 Res_d # exact: 2