function [Cv,Cm,Ctheta,Cdelta]= ...
constant(M1,M2,Blen,S_type, ...
Vl,Ml,Thetal,Deltal);
%
% [Cv,Cm,Ctheta,Cdelta]= ...
% constant(M1,M2,Blen,S_type, ...
% Vl,Ml,Thetal,Deltal);
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% This function determines the constants
% of integration for the beam.
%
% M1 - applied moment at left boundary
% M2 - applied moment at right boundary
% Blen - length of beam
% S_type - type of support system
% =1, pin-pin
% =2, fixed-fixed
% Vl - shear value for discontinuity
% function evaluated at x=Blen
% Ml - moment value for discontinuity
% function evaluated at x=Blen
% Thetal - rotation value for discontinuity
% function evaluated at x=Blen
% Deltal - deflection value for discontinuity
% function evaluated at x=Blen
%
% Cv - shear constant of integration
% Cm - moment constant of integration
% Ctheta - rotation constant of integration
% Cdelta - deflection constant of integration
%
% User m functions called: none.
%----------------------------------------------
if S_type == 1
%...pin-pin
Cv=(M2-M1-Ml)/Blen; Cm=M1; Cdelta=0;
Ctheta=-(Deltal+Cv*Blen^3/6+ ...
Cm*Blen^2/2)/Blen;
elseif S_type == 2
%...fixed-fixed
Ctheta=0; Cdelta=0;
a=[Blen^2/2 Blen ; ...
Blen^3/6 Blen^2/2];
b=[-Thetal; -Deltal];
x=a\b; Cv=x(1); Cm=x(2);
end