% convert  mine into dynare
% input: model;
%          number of leads (optional; if omitted number =5)

function [tmp]=mine2dyn(model,varargin);

if isempty(varargin);
maxll=5;
else
maxll=varargin{1};
end
nmod=size(model,1);
signs=strvcat('\+','\-');
signstr=strvcat('_plus','_minus');

dd=[];
tmp=model;
%for uu=1:nmod
for jj=1:maxll
    for kk=1:2
    tmp=regexprep(tmp,['(',deblank(signstr(kk,:)),num2str(jj),')*'],['(',deblank(signs(kk,:)),num2str(jj),')']);
%       tmp=regexprep(model,['([A-Za-Z_0-9\_]\(',signs(kk,:),num2str(jj),'\)[A-Za-Z_0-9\_\+\-\*\/\^])'],[signstr(kk,:),num2str(jj)]);

    %dd=[dd;[eval(maple('lhs',tmp)),eval(maple('rhs',tmp))]];
    end
end
%end