
% 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

% initial parameter definition
id = {
'C0102'
}; 
input = [
50.000000
];
saveParameters(id, input);

% initialize RTC Tools
RTCToolsMatlab('initialize');
RTCToolsMatlab('DA mode');

% problem definition
Prob = conAssign('jResCalibration', [], [], [], 20*ones(1,1), 80*ones(1,1), 'Name', input, [], [], [], [], []);
Prob.SOL.optPar(10) = 0.001;

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

% save optimized parameters
saveParameters(id, Result.x_k);

% close RTC Tools
RTCToolsMatlab('close');