#yspWGfhlin.m
function spF=yspWGfhlin(baasi0,l,x,GIt,EIw)
# sparse fransfer matrix of the of the first order analysis 
# for a beam  warping(Sign Convention 2)
#  Zx=F*Z0+lq
#  Z0'=[W0 Fi0 Q0 M0]
# 
#  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 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 != 5
if ~(nargin==5)
error(' function yspWGfhlin have wrong number of input arguments!') 
end
#%%%%%%%%%%%%%%%%%
# 
  i0=baasi0;
  nu=l*sqrt(GIt/EIw);
##  k=sqrt(GIt/EIw);
 nul=nu/l;
## nul=k;
 lnu=l/nu;
##lnu=1/k;
 nux=nul*x;
## nux=k*x;
 ch=cosh(nux);
 sh=sinh(nux);

Fsisse=[1  1  1.0;
#1  2  i0*x/GIt;  
#1  2 i0*lnu*sh/GIt; 
1  2  -i0*x/GIt;
1  3  i0*(ch-1)/GIt;
1  4  i0*lnu*(sh-nux)/GIt;
#1  4  i0*lnu*(sh-(nu*x/l))/GIt;
#2  2  1.0;  
#2  2  ch/GIt; 
2  2  -1.0;
2  3  nul*sh;
2  4  ch-1.0;
#3  2  0.0;
#3  2  lnu*sh;
3  3  -ch;
3  4  -lnu*sh; 
4  3  -nul*sh;
#4  3  0.0;
4  4  -ch];
#4  4  -1.0];
spF=spconvert(Fsisse);
#
endfunction
