%                       coefsSS.m
% Coefficients of selected Symmetric-Symmetric compositions
%               S_h = S_{as h}···S_{a1 h}
% Methods with number of stages s={1,3,5,7,9,15,17,19,33,35}
% for s={9,17,33} there are several choices (but only one by default)
% S. Blanes, F. Casas and A. Murua, Splitting methods for differential equations,
%   Acta Numerica (2024)     (Section 8, Table 8.1)

function [a] = coefsSS(s)
 % s = Number of stages 
if (s==1)  % 2nd-order: Strang
   a=[1];
elseif (s==3)  % 4th-order (CR90)
    a1=1/(2-2^(1/3));
    a2=1-2*a1;
    a3=a1;
   a=[a1 , a2 , a3];
elseif (s==5)  % 4th-order: (MCL95b)
    a1=0.28;
    a2=0.62546642846767004501;
  % 4th-order: Suzuki/Creutz&Gocksch (SUZ90)
    a1=1/(4-4^(1/3));
    a2=a1;
    a3=1-2*(a1+a2);
    a4=a2;    a5=a1;
   a=[a1,a2,a3,a4,a5];

elseif (s==7)  % 6th-order: (YOS90)
    a1=0.78451361047755726382;
    a2=0.23557321335935813368;
    a3=-1.17767998417887100695;
    a4=1-2*(a1+a2+a3);
    a5=a3;    a6=a2;    a7=a1;
   a=[a1,a2,a3,a4,a5,a6,a7];

elseif (s==9)  % 6th-order: (MCL95b)
    a1=0.1867;
    a2=0.55549702371247839916;
    a3=0.12946694891347535806;
    a4=-0.84326562338773460855;
  % 6th-order: (KR97)
    a1=0.39215846226558135393725811;
    a2=0.33260288849639382848984234;
    a3=-0.70624607359230088534941023;
    a4=0.08221272729243641010472095;
    a5=1-2*(a1+a2+a3+a4);
    a6=a4;    a7=a3;    a8=a2;    a9=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9];

elseif (s==11)  % 6th-order: (SS05)
    a1=0.21375583945878254555518066964857;
    a2=0.18329381407425713911385974425217;
    a3=0.17692819473098943794898811709929;
    a4=-0.44329082681170215849622829626258;
    a5=0.11728560432865935385403585669136;
    a6=1-2*(a1+a2+a3+a4+a5); %=0.50405474843802736404832781714239
    a7=a5;    a8=a4;    a9=a3;    a10=a2;    a11=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11];

elseif (s==13)  % 6th-order: (SS05)
    a1=0.13861930854051695245808013042625;
    a2=0.13346562851074760407046858832209;
    a3=0.13070531011449225190542755785015;
    a4=0.12961893756907034772505366537091;
    a5=-0.35000324893920896516170830911323;
    a6=0.11805530653002387170273438954049;
    a7=1-2*(a1+a2+a3+a4+a5+a6);%=0.39907751534871587459988795520665
    a8=a6;    a9=a5;    a10=a4;    a11=a3;    a12=a2;    a13=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13];

elseif (s==15)  % 8th-order: (MCL95b/KR97)
    a1=0.74167036435061295345;
    a2=-0.40910082580003159400;
    a3=0.19075471029623837995;
    a4=-0.57386247111608226666;
    a5=0.29906418130365592384;
    a6=0.33462491824529818378;
    a7=0.31529309239676659663;
    a8=1-2*(a1+a2+a3+a4+a5+a6+a7);
    a9=a7;    a10=a6;    a11=a5;    a12=a4;    a13=a3;    a14=a2;    a15=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15];

elseif (s==17) 
  % 8th-order: (KR97)
    a1=0.13020248308889008088;
    a2=0.56116298177510838456;
    a3=-0.38947496264484728641;
    a4=0.15884190655515560090;
    a5=-0.39590389413323757734;
    a6=0.18453964097831570709;
    a7=0.25837438768632204729;
    a8=0.29501172360931029887;
  % 8th-order: (MCL95b)
    a1=25/194;
    a2=0.58151408710525096243;
    a3=-0.41017537146985013753;
    a4=0.18514693571658773265;
    a5=-0.40955234342085141934;
    a6=0.14440594108001204106;
    a7=0.27833550039367965131;
    a8=0.31495668391629485789;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
    a9=1-2*(a1+a2+a3+a4+a5+a6+a7+a8);
    a10=a8;  a11=a7;  a12=a6;  a13=a5;  a14=a4;  a15=a3;  a16=a2;  a17=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17];

elseif (s==19)  % 8th-order: (SS05)
    a1= 0.10236997691919677217947233016768;
    a2= 0.15193719542124150042122517519886;
    a3=-0.25758500798800419714675345320434;
    a4= 0.22207280907359627745287320824157;
    a5= 0.14428079109272857169409977400023;
    a6= 0.45902412791454253044738988194508;
    a7=-0.35087981035009346255903840093339;
    a8= 0.12632969388923674360157818562148;
    a9= 0.14951143568721988602249080443402;
    a10=1-2*(a1+a2+a3+a4+a5+a6+a7+a8+a9);
    a11=a9;    a12=a8;    a13=a7;    a14=a6;    a15=a5;    
    a16=a4;    a17=a3;    a18=a2;    a19=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19];

elseif (s==21)  % 8th-order: (SS05)
    a1=0.10647728984550031823931967854896;
    a2=0.10837408645835726397433410591546;
    a3=0.35337821052654342419534541324080;
    a4=-0.23341414023165082198780281128319;
    a5=-0.24445266791528841269462171413216;
    a6=0.11317848435755633314700952515599;
    a7=0.11892905625000350062692972283951;
    a8=0.12603912321825988140305670268365;
    a9=0.12581718736176041804392391641587;
    a10=0.11699135019217642180722881433533;
    a11=1-2*(a1+a2+a3+a4+a5+a6+a7+a8+a9+a10);%=-0.38263596012643665350944670744040
    a12=a10;    a13=a9;    a14=a8;    a15=a7;    a16=a6;    a17=a5;
    a18=a4;    a19=a3;    a20=a2;    a21=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21];

elseif (s==31)  % 10th-order: (SS05)
    a1= 0.14998070054317051502516939497857;
    a2= 0.091208635101489291996105121514462;
    a3= 0.50623124887796194535266557555255;
    a4=0.094789715925889154094231454089204;
    a5=-0.19520875735034504160990960439871;
    a6= -0.38816256756251756192331854792644;
    a7=-0.27450555650873276528931810649505;
    a8= 0.14264675556451861069659069043321;
    a9= 0.067102518966825349346877396037809;
    a10= -0.19643186370792190448674783323248;
    a11= 0.29602854892160888804740587728740;
    a12=0.18917810251470701571585847859316;
    a13= 0.19394700133244324371285167850479;
    a14= 0.10120067580762238380456506324802;
    a15=-0.58186926782264021140090352527182 ;
    a16=1-2*(a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15); %=0.60772821879184217383575377417062 
    a17=a15;    a18=a14;    a19=a13;    a20=a12;    a21=a11;    a22=a10;
    a23=a9;    a24=a8;    a25=a7;    a26=a6;    a27=a5;    a28=a4;
    a29=a3;    a30=a2;    a31=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18...
       ,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31];

elseif (s==33)  
  % 10th-order:  (SS05)
    a1= 0.070711261586085399079302771810203;
    a2= 0.090342080937267568345577914389234;
    a3= 0.14103133297152486103524322594476;
    a4=0.40206004554029767537357060971803;
    a5=-0.30239722849131075165735249848238;
    a6= -0.22462355658241460137093154363351;
    a7=0.061496988956063121940380707068411;
    a8= 0.11346847775740802675296685287062;
    a9= 0.23654672241381781124636015203490;
    a10= 0.27211409645898977643699556260890;
    a11=0.076129418470277234386530906651024;
    a12= -0.18543093454238185309165565783301;
    a13= -0.46495110925607623804616342747217;
    a14=0.10423014962104084592532590279051;
    a15= 0.13621181452383232935841998116651;
    a16=-0.27010275720513252644976102610064;
%    a17=0.48632639368142264147037913293721;
  % 10th-order: Wanner (HLW02)
    a1= 0.0904061936858809100;
    a2= 0.535918159530527500;
    a3= 0.351232575475146500;
    a4=-0.311168020978355000;
    a5=-0.5255631419428331000;
    a6= 0.144479094102389600;
    a7= 0.0298358860973914600;
    a8= 0.1778617992374182000;
    a9= 0.09826906939336956000;
    a10=0.4617998621043849000;
    a11=-0.3337784559991042000;
    a12= 0.0709568483652747700;
    a13= 0.23666960070152720000;
    a14=-0.49725977950689580000;
    a15=-0.30399616617244460000;
    a16= 0.05246957188112882000;
  % 10th-order:  (KR97)
    a1= 0.12313526870982994083;
    a2= 0.77644981696937310520;
    a3= 0.14905490079567045613;
    a4=-0.17250761219393744420;
    a5=-0.54871240818800177942;
    a6= 0.14289765421841842100;
    a7=-0.31419193263986861997;
    a8= 0.12670943739561041022;
    a9= 0.17444734584181312998;
    a10= 0.44318544665428572929;
    a11=-0.81948900568299084419;
    a12= 0.13382545738489583020;
    a13= 0.64509023524410605020;
    a14=-0.71936337169922060719;
    a15= 0.20951381813463649682;
    a16=-0.26828113140636051966;
   % 10th-order: (TSI99)
    a1= 0.45238717224346720617;
    a2= 0.20175041403676403505;
    a3=-0.61511663906054518265;
    a4= 0.16433754952046729101;
    a5= 0.7426733143573198634;
    a6=-0.5824234473116445;
    a7=-0.39500619776092066;
    a8= 0.2072605028852482;
    a9= 0.190727289600012100;
    a10= 0.617877713318069357;
    a11=-0.19707721513930801013;
    a12= 0.10231129111935987310;
    a13=-0.866485197373761372;
    a14=-0.0080358392038535874;
    a15= 0.9398015671356833379000;
    a16= 0.02690013604768968151;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    a17=1-2*(a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16);
    a18=a16;    a19=a15;    a20=a14;    a21=a13;    a22=a12;    a23=a11;
    a24=a10;    a25=a9;    a26=a8;    a27=a7;    a28=a6;    a29=a5;
    a30=a4;    a31=a3;    a32=a2;    a33=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18...
       ,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33];

elseif (s==35)  
  % 10th-order:  (SS05)
    a1=0.07879572252168641926;
    a2=0.31309610341510852776;
    a3=0.02791838323507806610;
    a4=-0.22959284159390709415;
    a5=0.13096206107716486317;
    a6=-0.26973340565451071434;
    a7=0.07497334315589143566;
    a8=0.11199342399981020488;
    a9=0.36613344954622675119;
    a10=-0.39910563013603589787;
    a11=0.10308739852747107731;
    a12=0.41143087395589023782;
    a13=-0.00486636058313526176;
    a14=-0.39203335370863990644;
    a15=0.05194250296244964703;
    a16=0.05066509075992449633;
    a17=0.04967437063972987905;
    a18=1-2*(a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17);
    a19=a17;    a20=a16;    a21=a15;    a22=a14;    a23=a13;    a24=a12;
    a25=a11;    a26=a10;    a27=a9;    a28=a8;    a29=a7;    a30=a6;
    a31=a5;    a32=a4;    a33=a3;    a34=a2;    a35=a1;
   a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18...
     ,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35];
end

