#yspTVlin.m
function spF=yspTVlin(baasi0,l,x,GAr,EJ,GIt,EIw)
#
# sparse fransfer matrix 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 elemen
#  EJ - bending stiffness of the element
#  baasi0 - scaling multiplier for the displacements (i = EJ/l)
#
##=========================================================================
## This Program is written by Andres Lahe,   2009-02-14
##                    e-mail: andres.lahe@ttu.ee
## LAST MODIFIED: Andres Lahe,    2010-03-12
## Copyright (c)  2009  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 yspTVlin have wrong number of input arguments!') 
end
#%%%%%%%%%%%%%%%%%
# 
 x=l;
  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 8x8
  Fsisse=[1  1  1;
1  2  -x;
1  3  i0*x^3/(6*EJ);
#       -i0*x/GAr;
1  4  i0*x^2/(2*EJ);
2  2  1;
2  3  -i0*x^2/(2*EJ);
2  4  -i0*x/EJ;
3  3  -1;
4  3  -x;
4  4  -1;
5  5  1.0;
5  6  -i0*x/GIt;
5  7  i0*(ch-1)/GIt;
5  8  i0*lnu*(sh-nux)/GIt;
6  6  -1.0;
6  7  nul*sh;
6  8  ch-1.0;
7  7  -ch; 
7  8  -lnu*sh;
8  7  -nul*sh;
8  8  -ch];
spF=spconvert(Fsisse);
#
endfunction

#yspWGfhlin.m
#function spF=yspWGfhlin(baasi0,l,x,GIt,EIw)
#
#%%%%%%%%%%%%%%%%%
#if nargin != 5
%%if ~(nargin==5)
%%error(' function yspWGfhlin have wrong number of input arguments!') 
%%end
#%%%%%%%%%%%%%%%%%
# 

%%#Fsisse=[1  1  1.0;
%%Fsisse=[5  5  1.0;
%%#1  2  -i0*x/GIt;
%%5  6  -i0*x/GIt;
%%#1  3  i0*(ch-1)/GIt;
%%5  7  i0*(ch-1)/GIt;
%%#1  4  i0*lnu*(sh-nux)/GIt;
%%5  8  i0*lnu*(sh-nux)/GIt;
%%#2  2  -1.0;
%%6  6  -1.0;
%%#2  3  nul*sh;
%%6  7  nul*sh;
%%#2  4  ch-1.0;
%%6  8  ch-1.0;
%%#3  3  -ch;
%%7  7  -ch;
%%#3  4  -lnu*sh; 
%%7  8  -lnu*sh;
%%#4  3  -nul*sh;
%%8  7  -nul*sh;
#4  4  -ch];
%%8  8  -ch];
%%spF=spconvert(Fsisse);
#
%%endfunction