Home > demos > ac > accmds.m

accmds

PURPOSE ^

command templates for AC; run cell-by-cell;

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 command templates for AC; run cell-by-cell;

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % command templates for AC; run cell-by-cell;
0002 close all; clear all; 
0003 %% first two branches
0004 p=[];p=acinit(p);p=cont(p);
0005 q=swibra('p','bp1','q',0.1);
0006 q.amod=5;q.nsteps=10;q.lammax=3;q.smod=5;
0007 q=cont(q);
0008 r=swibra('p','bp2','r',0.1);
0009 r.amod=5;r.nsteps=15;r.lammax=4;r=cont(r);
0010 %% plot first bif-diagram
0011 figure(3);clf; plotbra(p,3,2,'ms',8,'lw',6); 
0012 plotbra(q,3,2,'ms',8,'lab',12,'lw',4, 'cl', 'b');
0013 plotbra(r,3,2,'ms',8,'lab',10,'lw',4, 'cl', 'r');
0014 xlabel('\lambda');ylabel('||u||_2');
0015 %% plotting from file
0016 plotsolf('q','p12',5,1,2); plotsolf('r','p10',7,1,2); 
0017 %% switch to continuation in diffusion constant
0018 clf(2); w=loadp('q','p12','w'); %w=q; w=setfn(w);
0019 w.up1=w.lam; % save the old lam as 'user-parameter'
0020 w.lam=0.25; % reset the new parameter lamda (=diff. coeff.)
0021 w.lammin=0.1;w.nsteps=20; w.restart=1; w.ds=-0.01; 
0022 w.xi=1e-6; % small xi since problem quite sensitive in diff coeff.
0023 w.f=@acfmu;w.jac=@acjacmu;  % new f, jac since new continuation param,
0024 w.jsw=1; % jsw=1 since Glam by finite differences
0025 %w.f=@acmuf; w.jsw=3; %alternative to above 2 lines; slower on fine meshes
0026 w=cont(w); plotsol(w,8,1,2);title('u at \mu=0.1, \lambda=2');
0027 %% example for tint: perturbation of unstable q5 into unstable manifold
0028 q=loadp('q','p3','q'); Gu=getGu(q,q.u,q.lam,r); 
0029 [K,MId]=assema(q.points,q.tria,0,1,0); 
0030 q.evopts=[]; q.evopts.disp=0;[phi1,mu1]=eigs(Gu,MId,1,0,q.evopts);
0031 mypause('Perturb in one direction');
0032 qa=q;qa.u=q.u-0.2*phi1;qa=tint(qa,0.2,200,40);plotsol(qa,9,1,1);
0033 mypause('Perturb in the other direction');
0034 qb=q;qb.u=q.u+0.2*phi1;qb=tint(qb,0.3,600,60);

Generated on Wed 15-Aug-2012 12:53:02 by m2html © 2005