% % macm 202 -- 27 dec 02 -- djm % % w1curve.m: complex curve demo, plots z(t) % & integrates of f(z) along z(t) % - to run, type "w1curve" at the matlab prompt % % clear workspace & graphics ("help clear", etc) clear; close all; disp(' ') % 'a' can be any COMPLEX value %1 global a; a = 0.0 + 0.0*i; % parameter vector T = 1; dt = 1/108; t = 0:dt:T; % plot curve of complex points zp = w1curve1(t,0); figure(1); %clf; plot(real(zp),imag(zp),'k.') hold on plot(real(zp( 1)),imag(zp( 1)),'ro') plot(real(zp(end)),imag(zp(end)),'rx') title('\bf my first complex-valued contour (with tangents)') xlabel('\bf real[z(t)]') ylabel('\bf imag[z(t)]') % tangent check tc = 0:0.1*T:T; z = w1curve1(tc,0); dzdt = w1curve1(tc,1); quiver(real(z),imag(z),real(dzdt),imag(dzdt),0.2) % complex contour integral zquad = quad(@w1curve2,0,T,1e-6); %1 disp(['a = ' num2str(a)]) %1 plot(real(a),imag(a),'b*') disp(['complex quadrature = ' num2str(zquad,'%2.4f')]) axis equal