% % generalized WKB -- code20.m (23 oct 2001 - djm) % %- - - - - - - - - - - - - - - - - - - - - - - - % coordinate matrices du = 0.02; u = du/2:du:2+du/2; up = -1.5-du/2:du:1.5+du/2; [u1 u2] = meshgrid(u,up); % first integral w/o damping global kk; kk = 1; integ = (u2.^2)/2 + (kk^2)*(u1.^2)/2 + (1/2)./(u1.^2); c0 = 0.5:0.1:0.9; cont = (kk^2)*(c0.^2)/2 + (1/2)./(c0.^2); % contourplot figure(2); clf; figure(1); clf; contour(u,up,integ,cont); hold on; title('\bf amplitude phase plane'); xlabel('\bf A(t)'); ylabel('\bf A\prime(t)') axis([0 2 -2 2]); axis square while(1) % ODE file, IVs, final time, method % & options Xode = 'code20a'; T = 100; method = 'ode45'; tol = 1e-6; % input IVs figure(1); clear IVs; IVs = input('initial A (0