
% startup
if (exist('initDone')==0),
	% startup TOMLAB
	addpath c:\tomlab;
	startup;

	% add bin folder to Matlab path and initialize RTC Tools
	addpath('../../x86-windows-vc-9.0/bin');
	
	initDone = 1;
end


% initialize RTC Tools
RTCToolsMatlab('initialize');

% initial guess for controlled variable
input = 1.0*ones([144 1]);

% problem definition
Prob = conAssign('jRes', 'jResDer', [], [], -100*ones(144,1), 100*ones(144,1), 'Name', input, [], [], [], [], []);
Prob.SOL.optPar(10) = 0.00001;

% derivative check
[exitFlag,output] = checkDerivs(Prob, input, 1, 1, [], []);

% optimization
% tic
% Result = tomRun('minos', Prob, 1);
% time=toc

% tic
% Result = tomRun('snopt', Prob, 1);
% time=toc

% close RTC Tools
RTCToolsMatlab('close');