%Minimum Singular Value Rule
%Scale the input using linear model such that each input has same effect on
%the cost J, get UscI.j= 1/(abs(Juu))^1/2, 3x1 matrix
%Load Juu.mat

clear all; close all; clc;

global coldata dyndata hydraulic termodata UU alfa

% Load the script file for optimal sensitivity calculation (Script_Fmatrix)
%Script_Fmatrix
load F1


% The value of Juu as calculated using central finite-diffrence approximation
% method
load Juu
%Juu=eye(3);
% The scaled model
load GY.mat


%Jud=inf;
%Gd1=inf;
%
load Wn.mat 
%Wn = 0.5*ones(72,72);
load Wndb.mat
%load F1.mat
%Branch and bound algorithm to calculate the worst minimu loss

load Jud

load GYd
tlimit = 200;
n = 3;
nc = 200;

%[Avloss,sset1,ops1,ctime,flag]= pb3av(GY,Wnd,Wn,Juu,F1,n,tlimit,nc);

%[Avloss2,sset2,ops2,ctime2,flag] = pb3av(GY,GYd,Wnd,Wn,Juu,Jud,n,tlimit,nc);
 [Avloss3,sset3,ops3,ctime3,flag]=b3av(GY,GYd,Wndb,Wn,Juu,Jud,tlimit,nc,F1)

