13.07.2015 Views

Contents

Contents

Contents

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AMATH 581 ( c○J. N. Kutz) 27break% get out of convergence loopendif (-1)^(modes+1)*y(end,1)>0 % this IF statement blockbeta=beta-dbeta; % checks to see if betaelse % needs to be higher or lowerbeta=beta+dbeta/2; % and uses bisection todbeta=dbeta/2; % converge to the solutionend %end % end convergence loopbeta_start=beta-0.1; % after finding eigenvalue, pick% new starting value for next modenorm=trapz(t,y(:,1).*y(:,1)) % calculate the normalizationplot(t,y(:,1)/sqrt(norm),col(modes)); hold on % plot modesend % end mode loopThe code uses ode45, whichisafourth-orderRunge-Kuttamethod,tosolvethe differential equation and advance the solution. The function shoot2.m iscalled in this routine. For the differential equation considered here, the functionshoot2.m would be the following:shoot2.mfunction rhs=shoot2(xspan,x,dummy,n0,beta)rhs=[ x(2)(beta-n0)*x(1) ];This code will find the first five eigenvalues and plot their correspondingnormalized eigenfunctions. The bisection method implemented to adjust thevalues of β n to find the boundary value solution is based upon observationsofthestructure of the even and odd eigenmodes. In general, it is always a good idea tofirst explore the behavior of the solutions of the boundary value problem beforewriting the shooting routine. This will give important insights into the behaviorof the solutions and will allow for a proper construction of an accurateandefficient bisection method. Figure 10 illustrates several characteristic featuresof this boundary value problem. In Fig. 10(a) and 10(b), the behavior of thesolution near the first even and first odd solution is exhibited. From Fig. 10(a)it is seen that for the even modes increasing values of β bring the solutionfrom ψ n (1) > 0toψ n (1) < 0. In contrast, odd modes go from ψ n (1) < 0toψ n (1) > 0asβ is increased. This observation forms the basis for the bisectionmethod developed in the code. Figure 10(c) illustrates the first four normalizedeigenmodes along with their corresponding eigenvalues.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!