%                       coefsSSproc.m
% Coefficients of selected processed symmetric-symmetric composition methods
% S_h= P_h^(-1) K_h P_h 
%    = (S_{-p1 h}···S_{-pn h}) (S_{ks h}···S_{k1 h}) (S_{pn h}···S_{p1 h})
% Collected methods with s-stage kernels with s={7,11,13,23}
% when s=13 there are two choices of order 6 and 8 (order 8 by default)
% S. Blanes, F. Casas and A. Murua, Splitting methods for differential equations,
%   Acta Numerica (2024)     (Section 8, Table 8.1)

function [k,p,np] = coefsSSproc(s)
% s = Number of stages 
if (s==7)  % 6th-order: (Blanes APNUM 2001)
    k1= 0.513910778424374; 
    k2= 0.364193022833858;
    k3= -0.867423280969274;
  k=[k1,k2,k3,1-2*(k1+k2+k3),k3,k2,k1];
 % Coefficients for the processor
     np=10;
    p5= 0.375012038697862; 
    p4= 0.384998538774070;
    p3=-0.074332422810238; 
    p2=-0.461165940466494;
    p1=-(p2+p3+p4+p5);
    p6=-p1;     p7=-p2;     p8=-p3;     p9=-p4;     p10=-p5; 
  p=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10];
elseif (s==11)  % 6th-order: (BCM06)
    k1= 0.1705768865009222157; 
    k5= -0.423366140892658048;
  k=[k1,k1,k1,k1,k5,1-2*(4*k1+k5),k5,k1,k1,k1,k1];
 % Coefficients for the processor
     np=12;
    p6=-0.1 ; 
    p5= 0.24687306977659; 
    p4= 0.09086982276241;
    p3=0.23651387483203; 
    p2=-0.20621953139126;
    p1=-(p6+p2+p3+p4+p5);
    p7=-p1;   p8=-p2;   p9=-p3;   p10=-p4;  p11=-p5;  p12=-p6;
  p=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12];
elseif (s==13) 
% order 8: (BCM06)
    k1= 0.168; 
    k3= 0.585550530805562; 
    k4= -0.460090457516872; 
    k5= 0.172863148729731; 
    k6=0.179664539695039;
    k7=1-2*(2*k1+k3+k4+k5+k6);
 k=[k1,k1,k3,k4,k5,k6,k7,k6,k5,k4,k3,k1,k1];
 % Coefficients for the processor
     np=20;
    p10= -0.543415765371656; 
    p9= 0.598212975943381; 
    p8= 0.236885952363384;
    p7=-0.511744926116413; 
    p6= 0.162324207599241;
    p5= 0.588351189003849;
    p4= 0.333987768164597;
    p3= -0.337188967354338;
    p2= -0.008488123494574411;
    p1=-(p10+p2+p3+p4+p5+p6+p7+p8+p9);
    p11=-p1;    p12=-p2;    p13=-p3;    p14=-p4;    p15=-p5; 
    p16=-p6;    p17=-p7;    p18=-p8;    p19=-p9;    p20=-p10;
 p=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12...
     ,p13,p14,p15,p16,p17,p18,p19,p20];

% 6th-order: (BCM06)
    k1= 0.125696288720106; 
    k5= 0.148070660114965; 
    k6=-0.350856370823828;
 k=[k1,k1,k1,k1,k5,k6,1-2*(4*k1+k5+k6),k6,k5,k1,k1,k1,k1];
 % Coefficients for the processor
     np=12;
    p1= 0.1; 
    p2= 0.225080298761176; 
    p3= 0.191244694511161;
    p4=-0.212763792194890; 
    p5=-0.09660157306582295 ;
    p6=-(p1+p2+p3+p4+p5);
    p7=-p1;   p8=-p2;   p9=-p3;  p10=-p4;   p11=-p5;   p12=-p6;
 p=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12];

elseif (s==23)  % order 10: (BCM06)
    k1= 0.121657748919383; 
    k6= -0.511318780154828; 
    k7= -0.172858614884985; 
    k8=0.123016258833066;
    k9=0.441503951671565;
    k10=-0.327071324165477;
    k11=0.070952700957766;
    k12=1-2*(5*k1+k6+k7+k8+k9+k10+k11);
 k=[k1,k1,k1,k1,k1,k6,k7,k8,k9,k10,k11,k12,k11,k10,k9,k8,k7,k6,k1,k1,k1,k1,k1];
     
 % Coefficients for the processor
     np=24;
    p12= 0.009116042043427756; 
    p11= 0.5334030283695922; 
    p10= 0.3430345669677392; 
    p9= -0.3594148033156072; 
    p8= 0.1548256472553489;
    p7=-0.1899795533199732; 
    p6= -0.5382945821834320;
    p5= -0.3045590922565247;
    p4= -0.4637104712987078;
    p3= 0.01344750613191108;
    p2= 0.4727142080578221;
    p1=-(p2+p3+p4+p5+p6+p7+p8+p9+p10+p11+p12);
    p13=-p1;    p14=-p2;    p15=-p3;    p16=-p4;    p17=-p5; 
    p18=-p6;    p19=-p7;    p20=-p8;    p21=-p9;    p22=-p10;
    p23=-p11;   p24=-p12;
 p=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19...
      ,p20,p21,p22,p23,p24];

end
