本文主要是介绍分数阶微积分,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
首先,创建函数glfdiff
function dy = glfdiff(y,t,gam)if strcmp(class(y),'function_handel')y = y(t);
endh = t(2)-t(1);
w = 1;
y = y(:);
t = t(:);for j = 2:length(t)w(j) = w(j-1)*(1-(gam+1)/(j-1));
end
for i = 1:length(t)dy(i) = w(1:i)*[y(i:-1:1)]/h^gam;
end
其次运行函数
常数的微积分
t=0:0.01:5;
u=ones(size(t));
y1=glfdiff(u,t,0.5);
y2=glfdiff(u,t,-0.5);
plot(t,y1,'+',t,y2,'-')
正弦函数的分数阶微积分f(t)=sin(t+1)
t=0:0.01:5;
u=sin(t+1);
ww=0:0.1:1;
Y=[];%这是什么意思,设置为空吗
for w=ww,Y=[Y;glfdiff(u,t,w)];end,
plot(t,Y);figure;surf(t,ww,Y)
这篇关于分数阶微积分的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!