lambda_s=-4*lambda*(a-1)/(4*lambda*(a-1)+a);
p0=-4*lambda*(1/(a^2)^(1/2)-1);
p1=(2*lambda)/(a^2)^(3/2);
p2=-(3*lambda)/(2*(a^2)^(5/2));
p3=(5*lambda)/(4*(a^2)^(7/2));
p4=-(35*lambda)/(32*(a^2)^(9/2));
p5=(63*lambda)/(64*(a^2)^(11/2));
k=[1+lambda_s,-lambda_s;-lambda_s,lambda_s+p0];
Num_Incremental_step=160;
Cs=[ cos(t) sin(t) cos(2*t) sin(2*t)];
A0=[zeros(1,length(A1)),A(1:length(A2),:)']';
KN11=quadv(fkn11,0,2*pi);
Kmc=omg0^2*M+omg0*C+K+3*KN3+5*KN5+7*KN7+9*KN9+11*KN11;
R=-F-(omg0^2*M+omg0*C+K+KN3+KN5+KN7+KN9+KN11)*A;
A0=[zeros(1,length(A1)),A(1:length(A2),:)']';
KN11=quadv(fkn11,0,2*pi);
Kmc=omg0^2*M+omg0*C+K+3*KN3+5*KN5+7*KN7+9*KN9+11*KN11;
R=-F-(omg0^2*M+omg0*C+K+KN3+KN5+KN7+KN9+KN11)*A;
disp(['增量步=' num2str(i),' 迭代次数=' num2str(I3),' 本增量步弧长=' num2str(delta_s),' 已计算到频率=' num2str(omg0)])
Harmonic_A=[Harmonic_A;A'];
Amplitude(i)=sqrt(A(2)^2+A(1)^2+A(3)^2+A(4)^2);
for i=Num_Pre_step+1:Num_Incremental_step
s(kk)=norm(X(:,kk+1)-X(:,kk));
tt(1)=0;tt(2)=s(1);tt(3)=tt(2)+s(2);tt(4)=tt(3)+s(3);tt(5)=tt(4)+delta_s;
PreValue_X=zeros(length_A+1,1);
aa=aa*((tt(5)-tt(jj))/(tt(ii)-tt(jj)));
PreValue_X=PreValue_X+aa*X(:,ii);
A=PreValue_X(1:length_A);
omg0=PreValue_X(length_A+1);
A0=[zeros(1,length(A1)),A(1:length(A2),:)']';
KN11=quadv(fkn11,0,2*pi);
Kmc=omg0^2*M+omg0*C+K+3*KN3+5*KN5+7*KN7+9*KN9+11*KN11;
R=-F-(omg0^2*M+omg0*C+K+KN3+KN5+KN7+KN9+KN11)*A;
DELTA_X=PreValue_X-X(:,4);
[~,flag]=max(abs(DELTA_X(1:length_A)));
Kmc(:,Note_flag)=-Rmc(:,1);
Kmc=Kmc(1:length_A,1:length_A);
Delta_X(length_A+1)=Delta_X(Note_flag);
Delta_A=Delta_X(1:length_A);
domg=Delta_X(length_A+1);
A0=[zeros(1,length(A1)),A(1:length(A2),:)']';
KN11=quadv(fkn11,0,2*pi);
Kmc=omg0^2*M+omg0*C+K+3*KN3+5*KN5+7*KN7+9*KN9+11*KN11;
R=-F-(omg0^2*M+omg0*C+K+KN3+KN5+KN7+KN9+KN11)*A;
Kmc(:,Note_flag)=-Rmc(:,1);
Kmc=Kmc(1:length_A,1:length_A);
Delta_X(length_A+1)=Delta_X(Note_flag);
Delta_A=Delta_X(1:length_A);
domg=Delta_X(length_A+1);
disp(['增量步=' num2str(i),' 迭代次数=' num2str(I3),' 本增量步弧长=' num2str(delta_s),' 已计算到频率比=' num2str(omg0)])
Harmonic_A=[Harmonic_A;A'];
Amplitude(i)=sqrt(A(2)^2+A(1)^2+A(3)^2+A(4)^2);
Result_A= [Result_A1,zeros(length(A),Num_Incremental_step-Num_Pre_step)]+ Result_A2;
plot(Frequency,Amplitude,'o-','linewidth',2,'color','b');