%minMaxGrfTVnurk.m
function MiMaSg=minMaxGrfTVnurk(LisaGr,Fvvs)
#close all 
#clear
## 
#dbwhere(240)
#
##=========================================================================
## This Program is written by Andres Lahe,   2015-03-30
##                    e-mail: andres.lahe@ttu.ee
## LAST MODIFIED: Andres Lahe,    2015-05-05
## Copyright (c)  2015  by Tallinn University of Technology 
##                Department of Mechanics
##                http://www.ttu.ee/%
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
## http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
##=========================================================================
#
#%%%%%%%%%%%%%%%%%
#if nargin != 2
if ~(nargin==2)
error(' function minMaxGrfTVnurk have wrong number of input arguments!') 
end
#%%%%%%%%%%%%%%%%%
## global Fvvs
epsgraf=1.0e-15;
SR=Fvvs(1:10,:);
%%%%%%%%
maxw=max(SR(1,:));
qLisa3=maxw*LisaGr;
maxw=maxw+qLisa3;
%
minw=min(SR(1,:));
qLisa4=(minw*LisaGr);
minw=minw+qLisa4;
%
if (minw-epsgraf<0)
minw=minw-qLisa3;
endif
%%%%%%%%%%
maxfi=max(SR(2,:));
qLisa3=maxfi*LisaGr;
maxfi=maxfi+qLisa3;
%
minfi=min(SR(2,:));
qLisa4=(minfi*LisaGr);
minfi=minfi+qLisa4;
%
if (minfi-epsgraf<0)
minfi=minfi-qLisa3;
endif
%%%%%%%%%%
maxQ=max(SR(3,:));
qLisa3=maxQ*LisaGr;
maxQ=maxQ+qLisa3;
%
minQ=min(SR(3,:));
qLisa4=(minQ*LisaGr);
minQ=minQ+qLisa4;
%
if (minQ-epsgraf<0)
minQ=minQ-qLisa3;
endif
%%%%%%%%%%
maxM=max(SR(4,:));
qLisa3=maxM*LisaGr;
maxM=maxM+qLisa3;
%
minM=min(SR(4,:));
qLisa4=(minM*LisaGr);
minM=minM+qLisa4;
%
if (minM-epsgraf<0)
minM=minM-qLisa3;
endif
%%%%%%%%%%
maxtheta=max(SR(5,:));
qLisa3=maxtheta*LisaGr;
maxtheta=maxtheta+qLisa3;
%
mintheta=min(SR(5,:));
qLisa4=(mintheta*LisaGr);
mintheta=mintheta+qLisa4;
%
if (mintheta-epsgraf<0)
mintheta=mintheta-qLisa3;
endif
%%%%%%%%%%%
maxTt=max(SR(6,:));
mLisa1=(maxTt*LisaGr);
maxTt=maxTt+mLisa1;
%
minTt=min(SR(6,:));
mLisa2=(minTt*LisaGr);
minTt=minTt+mLisa2;
%
if (minTt-epsgraf<0)
minTt=minTt-mLisa1;
endif
%%%%%%%%%%%%%
maxBw=max(SR(7,:));
qLisa3=(maxBw*LisaGr);
maxBw=maxBw+qLisa3;
%
minBw=min(SR(7,:));
qLisa4=(minBw*LisaGr);
minBw=minBw+qLisa4;
%
if (minBw-epsgraf<0)
minBw=minBw-qLisa3;
endif
%%%%%%%%%%%%%%
maxTw=max(SR(8,:));
mLisa1=(maxTw*LisaGr);
maxTw=maxTw+mLisa1;
%
minTw=min(SR(8,:));
mLisa2=(minTw*LisaGr);
minTw=minTw+mLisa2;
%
if (minTw-epsgraf<0)
minTw=minTw-mLisa1;
endif
%%%%%%%%%%%%
maxTsum=max(SR(9,:));
mLisa1=(maxTsum*LisaGr);
maxTsum=maxTsum+mLisa1;
%
minTsum=min(SR(9,:));
mLisa2=(minTsum*LisaGr);
minTsum=minTsum+mLisa2;
%
if (minTsum-epsgraf<0)
minTsum=minTsum-mLisa1;
endif
%%%%%%%%%%%%%%%%%%
maxw=maxw;
minw=minw;
maxfi=maxfi;
minfi=minfi;
maxQ=maxQ;
minQ=minQ;
maxM=maxM;
minM=minM;
matheta=maxtheta;
mitheta=mintheta;
maTt=maxTt;
miTt=minTt;
maBw=maxBw;
miBw=minBw;
maTw=maxTw;
miTw=minTw;
maMsum=maxTsum;
miMsum=minTsum;
%
MiMaSg=[maxw minw; maxfi minfi; 
maxQ minQ; maxM minM;
matheta mitheta; maTt miTt; 
maBw miBw; maTw miTw; maMsum  miMsum];
%
endfunction
