WORKSHEET for w1curve.m ----------------------- WARM-UP ------- - download into week1 folder: w1curve.m w1curve1.m w1curve2.m - matlab test: type w1curve there should be 3 actions. 1) a sequence of black dots marking out a (discretized) complex contour from z=1 to z=i 2) several blue arrows indicating the complex vector of the local derivative 3) numerical output of the integral of the function f(z) = 3*z.^2 along the plotted complex contour (sb. -1-i) STUDY #1 -------- - action: same integrand, but different contours - keyword: path independence * design your own complex contour z(t) which starts at z(0)=1 and ends at z(1)=i. use any combination of polynomial, trigonometric and exponential functions -- you will have to differentiate your contour. CREATIVITY COUNTS - modify a copy of w1curve1.m to utilize your new contour - function check: "w1curve1(0,0)" should return the endpoint. "w1curve1([0 1],0)" should return a row vector of the start/end points! - quick check: the blue arrows of the derivative z'(t) should be tangent to your contour! $ what is the numerically approximated (complex) value of the integral of f(z) = 3*z.^2 along this new contour? compare with other groups in the lab - change your plot labels - you should save backup of copies of your most useful modified versions of w1curve1.m STUDY #2 -------- - action: special integrand, closed scribbly contour - keyword: winding number * design your own closed "scribble" contour which has the form: zr = r(cos(2*pi*t), sin(2*pi*t)) .* cos(2*pi*K*t) zi = r(cos(2*pi*t), sin(2*pi*t)) .* sin(2*pi*K*t) where K is a reasonable integer and r(x,y) is a multivariable polynomial function of your choice which is POSITIVE EVERYWHERE on your contour (add a constant if you go negative). warning: use elementwise arithmetic. again creativity counts. remember, you will have to differentiate your contour - modify w1curve.m to utilize this complex contour - change the integrand function f(z) in w1curve2.m to be: f(z) = 1/(2*pi*i)./(z-a) by changing the commented (%1) lines. "a" is a complex constant which requires uncommenting 3 lines of code in w1curve.m and 2 lines in w1curve2.m -- they are marked by a "%1" - quick check: start=end, arrows are tangent to the contour & there is a blue star at the origin. oddly, the value of the numerical quadrature when a=0 looks like it takes the value of K - investigate in an orderly fashion what happens for different COMPLEX values of "a" -- watch the blue star! $ what do you believe this integral represents? where is the integral expression a continuous function of "a"? why are there discontinuities? - change your plot labels - back up your files STUDY #3 -------- - action: simple contour, rational function integrand - start from a fresh set of files - change the contour to be the unit circle zr = cos(2*pi*t) zi = sin(2*pi*t) - the new integrand will be a rational function: f(z) = (1/(2*pi*i)) * p'(z)./p(z) where p(z) is a 6th-degree polynomial whose coefficients are randomly chosen - the command: a = randn(1,6) generates a row vector of 6 random real numbers and defines a polynomial by p(z) = z.^6 + a(1)*z.^5 + ... a(5)*z + a(6) be sure to make "a" a global variable - the command: b = roots([1 a]) gives the 6 complex-valued roots of p(z)=0 - modify w1curve2.m to use the new integrand f(z). also the plotting command: plot(real(b),imag(b),'b*') puts useful stars on your plot. - quick check: start=end=1, arrows are tangent to unit circle of dots & the quadrature seems to give an integer less than 7 - change your plot labels $ draw conclusions