function xdot0 = initialize_xdot(model,params)

psidot = params.numerics.Upl0*ones(numel(model.psi.xind),1);
tedot  = zeros*ones(numel(model.te.xind),1);

if strcmp(model.ti.method,'state')
    tidot = tedot;
else
    tidot = [];
end

if strcmp(model.ne.method,'state')
    nedot = zeros*ones(numel(model.ne.xind),1);
else
    nedot = [];
end

if strcmp(model.ni.method,'state')
    nidot = zeros*ones(numel(model.ni.xind),1);
else
    nidot = [];
end

if strcmp(model.ntm.method,'state')
    ntmdot=zeros(model.ntm.n_ntm,1);
else
    ntmdot=[];
end
xdot0 = [psidot;tedot;tidot;nedot;nidot;ntmdot]; 

return