function Tr=ytransfp(S,l,EJ)
#ytransfp.m
# transformation matrix to transform the forces S and H  
# to forces N and Q in the second order analysis 
# Z=Tr*~Z, ~Z'=[~U ~W ~Fi ~S ~T ~M],
# Z'=[U W Fi N Q M], Fi=-dW/dx
#
##=========================================================================
## This Program is written by Andres Lahe,   1994-05-27
##                    e-mail: andres.lahe@ttu.ee
## LAST MODIFIED: Andres Lahe,    2009-02-17
## Copyright (c)  1994  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
##=========================================================================
#
# mark='+/-': tension: mark='-'; tension: mark='+';
#
  mark1='-'; mark2='+';
#
  if S>=0
     mark=mark2;
  end
  if S<0
     mark=mark1;
  end
     eps1=0.000001;
     nu=tnnusarv(l,S,EJ);
# compression
  if strcmp(mark1,mark) == 1
     if nu <= eps1
        nu=nu+eps1; S=0.0;
        Tr=eye(6);
#% xx='   Pikijõud puudub : S= ';
     else
        Tr=eye(6);
      Tr(5,3)=-nu^2*EJ/l^2;
#% xx='   Pikijõud survel : S= ';
     end
  end
# tension
  if strcmp(mark2,mark) == 1
     if nu <= eps1
        nu=nu+eps1; S=0.0;
        Tr=eye(6);
#% xx='   Pikijõud puudub : S= ';
     else
        Tr=eye(6);
      Tr(5,3)=nu^2*EJ/l^2;
#% xx='   Pikijõud tõmbel : S= ';
     end
  end
endfunction








