Contents

clear all; close all; format compact; clear classes;

init

ndim=1; dir='hom1d'; p=[]; lx=pi/1.4; nx=100;
par=[0.95; 2.75; 1; 1; 0.01; 0.1; 1]; % a, b, c, d, Du, Dv, Dw
p=bruinit(p,lx,nx,par,ndim); p=setfn(p,dir); p.sol.ds=0.01; p.nc.dsmax=0.025;
p.sw.bifcheck=2;  p.nc.neig=25; %p=cont(p,40);
p.pm.mst=5; p.nc.ntot=50; p.sw.rab=1; p0=p;
inires=3.55271e-15
first res=3.55271e-15
Problem directory name: hom1d
creating directory hom1d

initeig

p=p0; p=initwn(p,1,2); p=initeig(p,4); p.nc.neig=[3, 3]; p0=p;
setting om(2)=0.9375

cont (with bifpoint detection)

p=p0; p=cont(p,20);
step lambda      y-axis    residual iter meth   ds       #-EV 
   0 got first point with lam=2.75, res=3.55271e-15 
   - now lam=2.751
   1 got second point with lam=2.751, res=7.72372e-15 
   2    2.75955    2.90479 6.18e-14    0  nat    0.01000   0   0 
   3    2.77665    2.92279 2.92e-11    0  nat    0.02000   0   0 
   - 1 possible bif between 2.77665 and 2.79375, om=0.9375
 mu_r=4.22012e-06, mu_i=1.0093 
   4  2.79012e+00 (HP, saved to hom1d/hpt1.mat) bisection steps 10, last ds 9.76563e-06
   5    2.79375    2.94079 2.34e-11    0  nat    0.02000   0   0 
   - 1 possible bif between 2.79375 and 2.81085, om=0.9375
 mu_r=-0.00168681, mu_i=1.0093   - no convergence
   6    2.81085    2.95879 5.25e-11    0  nat    0.02000   0   1 
   7    2.82795    2.97679 4.75e-11    0  nat    0.02000   0   1 
   8    2.84505    2.99479 4.27e-11    0  nat    0.02000   0   1 
   - 1 possible bif between 2.84505 and 2.86215, om=0.9375
 mu_r=2.00977e-06, mu_i=0.926008 
   9  2.85001e+00 (HP, saved to hom1d/hpt2.mat) bisection steps 10, last ds 9.76563e-06
  10    2.86215    3.01278 4.16e-11    0  nat    0.02000   0   1 
   - 1 possible bif between 2.86215 and 2.87924, om=0.9375
...

Bif from BPs

p=swibra('hom1d','bpt1','1ds1',0.025); p.nc.dsmax=0.05; p=cont(p,20);
p=swibra('hom1d','bpt2','1ds2',0.025); p.nc.dsmax=0.05; p=cont(p,20);
lambda=2.91169, zero eigenvalue is -5.08295e-07
trivial swibra
Problem directory name: 1ds1
creating directory 1ds1
step lambda      y-axis    residual iter meth   ds       #-EV 
   - 1 possible bif between 2.91169 and 2.91176, om=0
 mu_r=-1.85826e-06, mu_i=0 
   1  2.91168e+00 (BP, saved to 1ds1/bpt1.mat) bisection steps 10, last ds 1.2207e-05
   2    2.91176    3.09264 5.98e-11    2  arc    0.02500   1   2 
   - 1 possible bif between 2.91176 and 2.91244, om=0
 mu_r=0.00023581, mu_i=0 
   3  2.91176e+00 (BP, saved to 1ds1/bpt2.mat) bisection steps 10, last ds -1.2207e-05
   4    2.91244    3.11342 3.04e-11    2  arc    0.02500   0   2 
   5    2.91467    3.12866 1.13e-11    2  arc    0.02500   0   2 
   - 1 possible bif between 2.91467 and 2.91948, om=0.9375
 mu_r=2.60198e-06, mu_i=1.04866 
   6  2.91654e+00 (HP, saved to 1ds1/hpt1.mat) bisection steps 10, last ds 1.2207e-05
   7    2.91948    3.14014 3.56e-12    2  arc    0.02500   0   2 
   - 1 possible bif between 2.91948 and 2.92757, om=0.9375
 mu_r=-0.00403714, mu_i=1.03452   - no convergence
...

Bifs from HBPs

para=4; ds=0.1; dsmax=0.2; xi=1e-3; nsteps=15; figure(2); clf; %br=2;
for bnr=1:3
switch bnr
 case 1; p=hoswibra('hom1d','hpt1',ds,para,'1dh1');
 case 2; p=hoswibra('hom1d','hpt2',ds/4,para,'1dh2'); nsteps=10; xi=1e-4;
 case 3; p=hoswibra('hom1d','hpt3',ds,para,'1dh3');
end
p.hopf.xi=xi; p.hopf.jac=1; p.nc.dsmax=dsmax; p.sw.verb=2;
p.fuha.blss=@mbel; p.nc.mbw=2; p.hopf.ilss=0; % set to 0 if no ilupack
t1=tic; p=cont(p,nsteps); toc(t1)
end
Problem directory name: 1dh1
creating directory 1dh1
real(mu)=4.22012e-06, imag(mu)=1.0093
lam=2.79012, om=1.0093,  NF-coeffis: dlam=1, alpha=10.6857
arc.parametr, lambda-guess=2.79021
max|y-u0|=1.2634, res=0.0410051
step  lambda      y-axis       res    iter  ds         T        nT   
   1    2.79355    3.07460  4.691e-09  5    0.10000    6.27858   21    0.02351    0.05072
   2    2.80053    3.17462  1.690e-09  2    0.10000    6.28180   21    0.03992    0.08716
   3    2.81105    3.27628  3.008e-09  2    0.10000    6.28657   21    0.05427    0.12069

 poor solve in mbel, |r|=0.0060667, b(end)=1, iterating ...it=1, |r|=1.15773e-07
   4    2.82489    3.37486  2.159e-11  3    0.10000    6.29272   21    0.06635    0.15114

 poor solve in mbel, |r|=0.00139535, b(end)=1, iterating ...it=1, |r|=1.14972e-08
   5    2.84177    3.46785  2.562e-11  3    0.10000    6.30003   21    0.07608    0.17834
   6    2.86136    3.56577  6.155e-12  3    0.10000    6.30825   21    0.08361    0.20237
   7    2.88331    3.66030  1.382e-12  3    0.10000    6.31716   21    0.08927    0.22344
   8    2.90730    3.74863  4.430e-13  3    0.10000    6.32659   21    0.09341    0.24177
   9    2.93303    3.84263  1.259e-12  3    0.10000    6.33637   21    0.09635    0.25755
...

2ndary Bifs

ds=0.05; p=hoswibra('1ds1','hpt1',ds,para,'1ds1h1');
p.hopf.xi=1e-4; p.nc.dsmax=0.3; p.sw.verb=2;
p.fuha.blss=@mbel; p.nc.mbw=2; p.hopf.ilss=0; % set to 0 if no ilupack
tic; p=cont(p,15); toc
Problem directory name: 1ds1h1
creating directory 1ds1h1
real(mu)=2.60198e-06, imag(mu)=1.04866
lam=2.91654, om=1.04866,  NF-coeffis: dlam=1, alpha=18.0895
arc.parametr, lambda-guess=2.91655
max|y-u0|=0.756574, res=0.0240174
step  lambda      y-axis       res    iter  ds         T        nT   

honloopext: damp alpha=0.25, res=0.141203, ds=0.05
      stepsizecontrol: res=0.0790247, reducing ds to 0.025

honloopext: damp alpha=0.25, res=0.0633639, ds=0.025
      stepsizecontrol: res=0.0287994, reducing ds to 0.0125
   1    2.92232    3.25487  1.734e-10  7    0.01250   -6.03312   21    0.31051    0.24517
   2    2.92575    3.28842  3.164e-09  2    0.02500   -6.02937   21    0.26431    0.30070

 poor solve in mbel, |r|=0.0628884, b(end)=1, iterating ...it=1, |r|=8.26231e-07
   3    2.93484    3.36216  7.495e-13  4    0.05000   -6.03648   21   -0.82165    0.19972

 poor solve in mbel, |r|=0.00782748, b(end)=1, iterating ...it=1, |r|=1.17852e-08
...

plot BD, L^2

bpcmp=9; wnr=3; figure(wnr); clf
plotbraf('hom1d','pt20',3,bpcmp,'cl','k', 'lwst',2);
plotbraf('1ds1','pt20',3,bpcmp,'cl','b');
plotbraf('1ds2','pt20',3,bpcmp,'cl',[0 0.25 1]);
plotbraf('1dh1','pt15',3,bpcmp,'cl',[1 0.5 0], 'lwst',2, 'lab',10);
plotbraf('1dh2','pt10',3,bpcmp,'cl',[1 0.5 0]);
plotbraf('1dh3','pt10',3,bpcmp,'cl',[1 0.5 0],'lab',5);
plotbraf('1ds1h1','pt15',3,bpcmp,'lab',[10],'cl','r');
axis([2.77 3 2.9 3.7]); xlabel('b'); ylabel('||u||_*');
text(2.8,3.35,'h1','fontsize',16); text(2.84,3.3,'h2','fontsize',16);
text(2.96,3.35,'h3','fontsize',16);text(2.9,3.1,'s1','fontsize',16);
text(2.89,3.32,'s1h1','fontsize',16);

plot solns

plotsolf('1ds1','hpt1',1,2,3); figure(1); v=[30 60];
title('s1/hpt1'); xlabel('x'); ylabel('u_1'); pause;
hoplotf('1dh1','pt10',1,1); figure(1); title('h1/pt10'); colormap cool; shading interp;
xlabel('x'); ylabel('t'); zlabel('u_1'); view(v); pause
hoplotf('1dh3','pt5',1,1); figure(1); title('h3/pt5'); colormap cool; shading interp;
xlabel('x'); ylabel('t'); zlabel('u_1');  view(v); pause
hoplotf('1ds1h1','pt10',1,1); figure(1); title('s1h1/pt10'); colormap cool; shading interp;
xlabel('x'); ylabel('t'); zlabel('u_1');  view(v);
lam=2.91654
lam=2.96022
lam=3.37335
lam=2.93485

stab check, init

p=loadp('1ds1h1','pt10'); hoplot(p,1,1); dir='stab1d';
p.u(1:p.nu)=p.hopf.y(1:p.nu,1); u0=p.u(1:p.nu); p=setfn(p,dir);
ts=[]; t0=0; npp=50; pmod=50; smod=5; tsmod=1; nc=0;
Problem directory name: stab1d
creating directory stab1d

tint

nt=1500; [p,t0,ts,nc]=hotintxs(p,u0,t0,ts,npp,nt,nc,tsmod,pmod,smod,@nodalf,1);
figure(4); clf; plot(ts(1,:), ts(2,:)); % point-vals
figure(5); clf; plot(ts(1,:), ts(3,:)); % difference in norm
set(gca,'FontSize',p.plot.fs); axis tight;
xlabel('t'); ylabel('||u(t)-u_0||_{\infty}');

x-t plot: (see in ts if there's something interesting after np periods,

then plot around there)

dir='stab1d'; wnr=2; cmp=1; incr=5; timesl=1;
switch timesl; % choose timelslice to plot
    case 0; si=0; nt=1*npp/smod; zti=[0.8 1.2]; yti=[0 5];
    case 1; si=350; nt=2*npp/smod; zti=[1 1.5]; yti=[5 10 15 20 25 30 35 40 45 50];
    case 2; si=1300; nt=2*npp/smod; zti=[0.6 1.2 1.8]; yti=[150 155 160 165 170];
end
vv=[30,70]; tintplot1d(dir,si,incr,nt,wnr,cmp,vv);
colormap cool; shading interp; view(30,70); grid off;
set(gca,'YTick',yti); set(gca,'ZTick',zti);
xlabel('x'); ylabel('t'); zlabel('u_1')