%% Initial point script
clear all
clc

% Load information from the steady state results 
filename='SSresults.mat';
[w0,lb,ub] = Initialp(filename);

% Run optimization for the base case
tic
options = optimoptions('fmincon','Algorithm', 'interior-point', 'Diagnostics','on','PlotFcns',{...
@optimplotfval,@optimplotfirstorderopt,@optimplotconstrviolation},...
'FunValCheck','on' ,'TolCon', 1e-4,'TolFun', 1e-4, 'MaxIter', 16000,...
'MaxFunEvals', 150000, 'TolX', 1e-10, 'ScaleProblem','obj-and-constr',...
'UseParallel',true,'FinDiffType','forward');
[w,f,eflag,outpt,w0] = runobjconst(w0,lb,ub,options, 0,1 ,1,1);
t=toc

% Save results
file='EOSS.mat';
save(file)