function [j] = jResCalibration(input)
% function [j] = jResCalibration(input)

id = {
'ECORR1',
'ECORR2',
'ECORR3',
'ECORR4',
'TT',
'TTI',
'CFMAX',
'CFR',
'CWH',
'TM',
'BETA',
'CFLUX',
'ETF',
'FC',
'LP',
'ALPHA',
'K',
'K1',
'PERC'
};  
saveParameters(id, input);

% model simulation
j = -RTCToolsMatlab(input)

input0 = [
1.0
1.0
1.0
1.0
1.0
2.0
3.0
0.8
0.1
1.0
1.2
0.05
0.15
250.0
0.4
0.5
0.04
0.10
3.5];

j = j + 0.01*sum(((input-input0)./input0).^2);
