function con = Uzero(m)
%UZERO Default structure for Kronecker Bio experimental conditions
% 
%  This function returns a valid, empty, experiment. It is used for
%  making experiments constructed by different means consistent so that
%  their srtuctures can be combined.

% (c) 2010 David R Hagen & Bruce Tidor
% This work is released under the MIT license.

if isnumeric(m)
    temp = struct('name', [], 'tF', [], 'u', [], 'dudp', [], 'tStop', [], 'events', [], 'nEvents', [], 'periodic', [], 'steadyState', [], 'firstEvent', [], 'ic', [], 'update', []);
    if isempty(m)
        m = 1;
    end
    if ~isscalar(m)
        obj(prod(m),1) = temp;
        con = reshape(obj, m);
        return
    else
        con(m,1) = temp;
        return
    end
end

% Constants
nU = m.nU;
nP = m.nP;

% Gut m
temp = m;
clear m
m.nU = temp.nU;
m.nP = temp.nP;
m.ic = temp.ic;
clear temp

con.name = 'unnamed';
con.tF = 0;
con.u = @u;
con.dudp = @dudp;
con.tStop  = [];
con.events = [];
con.nEvents = [];
con.periodic = false;
con.steadyState = false;
con.firstEvent = 0;
con.ic = m.ic;
con.update = @update;

    function con = update(mNew, icNew)
        con = Uzero(mNew);
    end
    function val = u(t)
        val = zeros(nU, 1);
    end
    function val = dudp(t)
        val = zeros(nU, nP);
    end
end