#%ylTVlin.m
function F=ylTVlin(baasi0,l,x,GAr,EJ,GIt,EIw)
# fransfer matrix F(4,4) of the of the first order analysis 
# for a beam (Sign Convention 2)
# Zx=F*Z0+lq
# Z0'=[W0 Fi0 Q0 M0]
#  GAr - shear stiffness of the element
#  EJ - bending stiffness of the element
#  baasi0 -- scaling multiplier for the displacements (i = EJ/l)
#
#
##=========================================================================
## This Program is written by Andres Lahe,   1998-05-20
##                    e-mail: andres.lahe@ttu.ee
## LAST MODIFIED: Andres Lahe,    2009-02-13
## Copyright (c)  1998 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 != 7
if ~(nargin==7)
error(' function ylTVlin 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);
#%%%%%%%%%%%% Tala %%%%%%%%%%%%
## F=eye(4);
  F(1,1)=1;
 F(1,2)=-x;
 F(1,3)=i0*x^3/(6*EJ);
# -i0*x/GAr;
 F(1,4)=i0*x^2/(2*EJ);
  F(2,2)=1; 
 F(2,3)=-i0*x^2/(2*EJ);
 F(2,4)=-i0*x/EJ;
 F(3,3)=-1;
 F(4,3)=-x;
 F(4,4)=-1;
#
F(5,5)=1.0;
F(5,6)=-i0*x/GIt;
F(5,7)=i0*(ch-1)/GIt;
F(5,8)=i0*lnu*(sh-nux)/GIt;
F(6,6)=-1.0;
F(6,7)=nul*sh;
F(6,8)=ch-1.0;
F(7,7)=-ch; 
F(7,8)=-lnu*sh;
F(8,7)=-nul*sh;
F(8,8)=-ch;
%
endfunction


