function Fzx=ylfhvzII(baasi0,S,x,l,a,Fz,EJ)
# 
#  Fz -point load acts in the z direction
#  second order analysis
#  a - distance of a load point  from start point
#  EJ - bending stiffness of the element
#  baasi0 - scaling multiplier for the displacements (i = EJ/l)
#  [Up Wp Fip Sv Hp Mp] = ylfII*[Uv Wv Fiv Sv Hv Mv]
#  Fi=-dw/dx
# 
##=========================================================================
## This Program is written by Andres Lahe,   1998-06-26
##                    e-mail: andres.lahe@ttu.ee
## LAST MODIFIED: Andres Lahe,   2009-05-16
## 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
##==========
##
   EA=1.0*10^15; 
Fx=0.0;
 xp=x-a;
Fx=0;
#
# mark='+/-'; survel: mark='-'; tõmbel: mark='+';
  mark1='-'; mark2='+';
#
  Fzx=zeros(6,1);
#
 if S>=0
    mark=mark2;
 endif
 if S<0 
    mark=mark1;
 endif
  eps1=0.000001; eps2=0.0000001;
     nu=tnnusarv(l,S,EJ);
# compression
if strcmp(mark1,mark) == 1
   if nu <=eps1
     #pikijoud puudub
     nu=nu+eps1; #S=0.0;
     Fzx=yzfzv(baasi0,x,a,Fx,Fz,EA,EJ);
   else
     cs=cos(nu*(x-a)/l);
     ss=sin(nu*(x-a)/l);
       if xp>=0
       Fzx(1,1)=0.0;
       Fzx(2,1)=-baasi0*(Fz*l^3)*(ss-(nu*(x-a)/l))/(nu^3*EJ);
       Fzx(3,1)=baasi0*(Fz*l^2)*(cs-1)/(nu^2*EJ);
       Fzx(4,1)=0.0;
       Fzx(5,1)=-Fz;
       Fzx(6,1)=-Fz*l*ss/nu;
      else
       Fzx(1,1)=0;
       Fzx(2,1)=0;
       Fzx(3,1)=0;
       Fzx(4,1)=0;
       Fzx(5,1)=0;
       Fzx(6,1)=0;
      endif
   endif
endif
# tension
if strcmp(mark2,mark) == 1
   if nu <=eps1
    #pikijoud puudub
     nu=nu+eps1;   # S=0.0;	
     Fzx=yzfzv(baasi0,x,a,Fx,Fz,EA,EJ);
   else
     cs=cosh(nu*(x-a)/l);
     ss=sinh(nu*(x-a)/l);
      if xp>=0
       Fzx(1,1)=0.0;
       Fzx(2,1)=baasi0*(Fz*l^3/EJ)*(ss-(nu*(x-a)/l))/(nu^3*EJ);
       Fzx(3,1)=-baasi0*(Fz*l^2)*(cs-1)/(nu^2*EJ);
       Fzx(4,1)=0.0;
       Fzx(5,1)=-Fz;
       Fzx(6,1)=-Fz*l*ss/nu;
      else
       Fzx(1,1)=0;
       Fzx(2,1)=0;
       Fzx(3,1)=0;
       Fzx(4,1)=0;
       Fzx(5,1)=0;
       Fzx(6,1)=0;
      endif
   endif
endif
# 
endfunction






