Escolar Documentos
Profissional Documentos
Cultura Documentos
FCC Toolbox: Solving linear delayed fractional differential equations (only Single delay
equation) ........................ 1
Syntax ............................................................................................................................... 1
Variables ........................................................................................................................... 1
Inputs ................................................................................................................................ 1
Example 1: ......................................................................................................................... 2
Example 2: ......................................................................................................................... 2
Example 3: ......................................................................................................................... 3
Example 4: ......................................................................................................................... 4
Solving linear fractional delay differential equations ................................................................. 5
Example 1: ......................................................................................................................... 5
Example 2: ......................................................................................................................... 7
Example 3: ......................................................................................................................... 9
Example 4: ......................................................................................................................... 9
Example 5: ....................................................................................................................... 10
Example 6: ....................................................................................................................... 11
Syntax
[t,x]=fddes(FDDEs,TIME,'alpha',ALPHA,'x0',X0,'N',N,'delay',DELAYS,'his',ICFUN,'meth
Variables
t: is the differetial equation variable
D1x1 OR Dx1 first derivative of x1
Da1x1: fractional derivative of x1
Dd1x1: time-delayed x1
Dd1D1x1 OR Dd1Dx1: time-delayed first derivative of x1
Dd1Da1x1 OR Dd1Dx1: time-delayed fractional-order derivative of x1
Inputs
FDDEs:'fdde1;fdde2;fdde3;...;fdden'
ALPHA: a row vector stor the fractional orders
X0: initical conditions
Example 1:
[t,y]=fddes('Dx1+10*x1',[0 10],'N',100,'x0',[1],'method','CA');
figure;plot(t,y);
title('$\dot x+10x=0$, $x(0)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Example 2:
figure;
INDEX=linspace(0.1,1,10);
cc=jet(numel(INDEX));
for i=1:numel(INDEX)
[t,y]=fddes('Da1x1+x1',[0 10],'alpha',INDEX(i),'N',100,'x0',
[1],'method','CA');
plot(t,y,'color',cc(i,:)); hold all;
end
c=colorbar('southoutside');c.Label.String = '\alpha';
title('$^C_0D_x^\alpha[x]+x=0$, $0<\alpha\leq 1$,
$x(0)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Example 3:
figure;
INDEX=linspace(0.1,1,10);
cc=jet(numel(INDEX));
for i=1:numel(INDEX)
[t,y]=fddes('Dx1-x2;Dx2+Da1x1+10*x1',[0
2],'alpha',INDEX(i),'N',30,'x0',[1 -1],'method','CA');
plot(t,y,'color',cc(i,:)); hold all;
end
c=colorbar('southoutside');c.Label.String = '\alpha';
title('$\ddot x+^C_0D_x^\alpha[x]+10x=0$, $0<\alpha\leq 1$, $x(0)=1$,
$\dot x(0)=-1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Example 4:
figure;
INDEX=linspace(0.1,1,10);
cc=jet(numel(INDEX));
for i=1:numel(INDEX)
[t,y]=fddes('Dx1-x2;Dx2+Da1x1+sin(t)*x1-exp(-t)',[0
5],'alpha',INDEX(i),'N',30,'x0',[1 -1],'method','CA');
plot(t,y,'color',cc(i,:)); hold all;
end
c=colorbar('southoutside');c.Label.String = '\alpha';
title('$\ddot x+^C_0D_x^\alpha[x]+\sin(t)x=\exp(-t)$, $0<\alpha\leq
1$, $x(0)=1$, $\dot x(0)=-1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Example 2:
figure;
INDEX=linspace(0.01,2,10);
cc=jet(numel(INDEX));
for i=1:numel(INDEX)
[t,y]=fddes('D1x1+Dd1x2;Dx2-x1*sin(t)',[0 10],'alpha',
[1],'delay',INDEX(i),'N',100,'his','t;1','method','CA');
plot(t,y,'o','color',cc(i,:)); hold all;
fun=@(t,x,z) [-z(2);sin(t)*x(1)];
his=@(t,x) [t;1];
sol=dde23(fun,INDEX(i),his,[0,10]);
plot(sol.x,sol.y,'color',cc(i,:));
end
c=colorbar('southoutside');c.Label.String = '\tau';
title('$\dot x_1=x_2(t-\tau);\dot x_2=\sin(t)x_1$, $\tau=2$,
$x_1(\tau)=\tau$, $ x_2(\tau)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Warning: The number of fractional orders is less than the number of
Da. All the
fractional orders are considered as ALPHA=1.00
Warning: The number of fractional orders is less than the number of
Da. All the
fractional orders are considered as ALPHA=1.00
Example 3:
[t,y]=fddes('D1x1-x2;Dx2+x1+Dd1x2',[0 4],'alpha',[1],'delay',
[2],'N',100,'his','t;1','method','CA');
figure;plot(t,y,'o'); hold all;
fun=@(t,x,z) [x(2);-x(1)-z(2)];
his=@(t,x) [t;1];
sol=dde23(fun,2,his,[0,4]);
plot(sol.x,sol.y);
title('$\dot x_1=x_2(t);\dot x_2=-x_1+x_2(t-\tau)$, $\tau=2$,
$x_1(\tau)=t$, $ x_2(\tau)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Warning: The number of fractional orders is less than the number of
Da. All the
fractional orders are considered as ALPHA=1.00
Example 4:
[t,y]=fddes('D1x1-x2;Dx2+x1+Dd1Da1x1',[0 20],'alpha',[1],'delay',
[2],'N',100,'his','t;1','method','CA');
figure;plot(t,y,'o'); hold all;
fun=@(t,x,z) [x(2);-x(1)-z(2)];
his=@(t,x) [t;1];
sol=dde23(fun,2,his,[0,20]);
plot(sol.x,sol.y);
title('$\dot x_1=x_2(t);\dot x_2=-x_1+\dot x_1(t-\tau)$, $\tau=2$,
$x_1(\tau)=t$, $ x_2(\tau)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
Example 5:
[t,y]=fddes('D1x1-x2;D1x2+x1+Dd1Da1x1',[0 10],'alpha',[0.99],'delay',
[2],'N',100,'his','t;1','method','CA','varN',0);
figure;plot(t,y,'o'); hold all;
fun=@(t,x,z) [x(2);-x(1)-z(2)];
his=@(t,x) [t;1];
sol=dde23(fun,2,his,[0,10]);
plot(sol.x,sol.y);
title('$\dot x_1=x_2(t);\dot x_2=-x_1+^C_0D_x^\alpha [x_1(t-\tau)]$, $
\tau=2$, $x_1(\tau)=t$, $ x_2(\tau)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
10
Example 6:
[t,y]=fddes('D1x1-x2;D1x2+x1+Dd1Da1x1',[0 10],'alpha',[0.99],'delay',
[2],'N',100,'his','t;1','method','CA','varN',1);
figure;plot(t,y,'o'); hold all;
fun=@(t,x,z) [x(2);-x(1)-z(2)];
his=@(t,x) [t;1];
sol=dde23(fun,2,his,[0,10]);
plot(sol.x,sol.y);
title('$\dot x_1=x_2(t);\dot x_2=-x_1+^C_0D_x^\alpha [x_1(t-\tau)]$, $
\tau=2$, $x_1(\tau)=t$, $ x_2(\tau)=1$','interpreter','latex');
xlabel('$t
$','interpreter','latex');ylabel('$x(t)$','interpreter','latex');
11
12