function [x,b,exflg,Uout] = SampRose(~,Uin,~,~,~,~,~,~,~)

% This function defines the Rosenbrok function in the case of sampling.
%
% Written by Julian Straus, Trondheim 09.12.2018
%
% The needed input for this function are
%   Uin:        A column matrix or column vector defining the input values 
%               for the sampling of the variables.
%
% The output is defined as
%  	x:          States of the system, calculated via the non-linear system
%               of equations.
%
%   b:      	Residual in the Newton-Raphson approach
%
%   exflg:      Exitflag of fsolve.
%
%   Uout:       A column matrix or column vector defining the input values 
%               for the sampling of the variables. Uout equals Uin except
%               in the HYSYS cases.

% Redefinition of the screening values
Uout = Uin(end,:);

% Calculation of the solution
x = (1-Uout(:,1)).^2 + 100*(Uout(:,2)-Uout(:,1).^2).^2;

% Assignment of unused vectors
b = [];
exflg = 1;
