#%ylWGfhlin.m
function FF=ylWGfhlin(baasi0,l,x,GIt,EIw)
# fransfer matrix F(4,4) of the of the first order analysis 
# for a beam warping (Sign Convention 2)
# Zx=F*Z0+lq
# Z0'=[Fi0 Tt B Tw]
#  l - length of the element
#  GIt - torsional stiffness
#  EIw - warping stiffness
#  baasi0 - scaling multiplier for the displacements (i = GIt)
#
#
##=========================================================================
## This Program is written by Andres Lahe,   2015-03-30
##                    e-mail: andres.lahe@ttu.ee
## LAST MODIFIED: Andres Lahe,    2015-03-30
## Copyright (c)  2015 by Tallinn University of Technology 
##                Department of Mechanich
##                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 != 5
if ~(nargin==5)
error(' function ylWGfhlin have wrong number of input arguments!') 
end
#%%%%%%%%%%%%%%%%%
# 
  i0=baasi0;
  nu=l*sqrt(GIt/EIw);
 nul=nu/l;
 lnu=l/nu;
 nux=nul*x;
 ch=cosh(nux);
 sh=sinh(nux);

 F=zeros(4,4);
 F(1,1)=1.0;
 F(1,2)=-i0*x/GIt;
# F(1,2)=i0*x/GIt;
# F(1,2)=i0*lnu*sh/GIt;
# F(1,3)=i0*(ch-1)/GIt;
 F(1,3)=i0*(ch-1)/GIt; 
# F(1,4)=i0*lnu*(sh-nux)/GIt;
 F(1,4)=i0*lnu*(sh-nux)/GIt; 
# F(1,4)=i0*lnu*(sh-(nu*x/l))/GIt; 
 F(2,2)=-1.0;
# F(2,2)=ch/GIt;
# F(2,2)=1.0; 
 F(2,3)=nul*sh;
 F(2,4)=ch-1.0;
# F(3,2)=lnu*sh; 
 F(3,3)=-ch;
 F(3,4)=-lnu*sh;
 F(4,3)=-nul*sh;
# F(4,3)=0.0;
F(4,4)=-ch;
# F(4,4)=-1.0; 
#
FF=F;
#
endfunction

