% script 
close all; clear all; path('../../pde2p',path); path('../../aux',path);
p=[]; p=bratuinit(p); p=cont(p); % homogeneous branch 
%% 2 branch switchings and successive continuation
q=swibra('p','bp1','q'); q.lammin=0.09;q.nsteps=21;q=cont(q); 
r=swibra('q','bp1','r'); r.lammin=0.05;r.nsteps=20;r=cont(r); 
%% postprocessing, first plot BifDiagram 
figure(3);clf(3);
plotbra(p,3,2,'ms',12,'lwst',5,'lwun',2,'fs',16,'cl','k');
plotbra(q,3,2,'ms',12,'lwst',6,'lwun',2,'lab',[20],'fs',16,'cl','b');
plotbra(r,3,2,'ms',12,'lwst',6,'lwun',2,'lab',[20],'fs',16,'cl','r');
axis([0.05 0.37 0.5 3.5]);xlabel('\lambda');ylabel('||u||_2');
%% plot solutions 
plotsolf('q','p20',7,1,1); % mesh plot 
figure(7); view(-30,50); xlabel('x');ylabel('y');
plotsolf('r','p20',8,1,3); % rendered 3D plot 
figure(8); view(-30,50); xlabel('x');ylabel('y');