《灰色系统理论及其应用》第7版 刘思峰 P193 9.3基于Captuo模型分数阶导数的灰色模型

%《灰色系统理论及其应用》第7版 刘思峰 P193 9.3基于Captuo模型分数阶导数的灰色模型 
%实现 ,采用例9.2.1的数据完成分析

clear all,clc,close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%求X0的p阶差分,相当于
%先进行1-p阶(=1-0.1=0.9)累加,得到累加序列X1p,再进行1阶累减。

X0=[247.839,273.021,289.014,285.208,288.818,297.078];

p=0.98;

p1=1-p;   %-代表分数阶

X1p=[];

for k = 1:length(X0)

    s=0;

    for i=1:k    

        product=1;

        if ii-1)

                product=product*(p1+j);

            end

            s=s+ product/factorial(k-i)*X0(i);       

        else

            s=s+X0(k);

        end

    end

    X1p=[X1p,s];

end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 对累加序列X1p1次累减,得到X0的p阶差分X0_p
X1p_1=[0 X1p(1:end-1)];
X0_p=X1p-X1p_1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 计算发展系数-a, 灰色作用量b
%
Y=X0_p(2:end)';
Z=(X0(1:end-1)+X0(2:end))/2;
B=[-Z' ones(length(X0)-1,1)];
ab=inv(B'*B)*B'*Y;
a=ab(1)
b=ab(2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
X0y=[];
syms n;
for k=1:length(X0)
    X0y=[X0y (X0(1)-b/a)*double(symsum((-a*k^p)^n/gamma(p*n+1),n,0,Inf))+b/a];
end
X0y



















你可能感兴趣的:(MATLAB,符号计算)