#yzTVqz.m
function Zq0=yzTVqz(baasi0,x,a,qz,EJ)
# 
#  computed a loading vector for uniformly distributed load for a beam 
#  qz -- uniformly distributed load along the z-axis
#  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)  2004  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 yzTVqz have wrong number of input arguments!') 
end
#%%%%%%%%%%%%%%%%% 
#
i0=baasi0;
#
  xp=x-a;
Zq0=zeros(8,1);  
#%%%%%%%%%%%%% Tala %%%%%%%%%%%%%%
 if xp>=0
Zq0(1,1)=i0*qz*xp^4/(24*EJ);
Zq0(2,1)=-i0*qz*xp^3/(6*EJ);
Zq0(3,1)=-qz*xp;
Zq0(4,1)=-qz*xp^2/2;
else
Zq0(1,1)=0.0;
Zq0(2,1)=0.0;
Zq0(3,1)=0.0;
Zq0(4,1)=0.0;
 endif
#
endfunction
