function [y1,T,y0] = ex1(t,y,jaco)
%
% [alpha,T,y0] = ex1
%
% or
%            f = ex1(t,y)
%
% or
%           f' = ex1(t,y,1)
%
% or
%            y = ex1(t)
%
% Example 1 in:
%
%  L.Brugnano, G.Gurioli, F.Iavernaro. Numerical solution of FDE-IVPs by 
%  using fractional HBVMs: the fhbvm code. Numerical Algorithms (2024). 
%  https://doi.org/10.1007/s11075-024-01884-y
%
alfa = 0.3;
if nargin==0    % problem data
    y1   = alfa;
    T    = 1;
    y0   = 0;
elseif nargin==1 % solution
    y1   = t.^8-3*t.^(4+alfa/2)+(9/4)*t.^alfa;
elseif nargin==2 % vector field
    y1   = -abs(y).^(3/2) +( 40320/gamma(9-alfa) )*t.^(8-alfa) -...
           3*( gamma(5+alfa/2)/gamma(5-alfa/2) )*t.^(4-alfa/2) +...
           ( (3/2)*t.^(alfa/2) - t.^4 ).^3 + (9/4)*gamma(alfa+1);
else             % Jacobian
    y1   = -1.5*sqrt(abs(y));
end
return
           