% Aufgabe 18-15

clear all

L1  =   1200 ;
L2  =   1300 ;
EI1 =    3e9 ;
EI2 =    5e9 ;
q1  =    1.4 ;
M   = 220000 ;
F   =    800 ;
c1  =     50 ;
c2  =    300 ;
cT  =    5e6 ;

A = [   0     -EI1    0     0           0               0        0   0  ;
      -EI1      0     0    -c1          0               0        0   0  ;
     L1^3/6  L1^2/2  L1     1           0               0        0  -1  ;
       L1       1     0     0           0               0        0   0  ;
        0       0     0     0           0               1        0   0  ;
      -EI1      0     0     0          EI2              0        0  c2  ;
        0       0     0     0         L2^3/6         L2^2/2     L2   1  ;
        0       0     0     0   -EI2*L2-cT*L2^2/2  -EI2-cT*L2  -cT   0  ] ; 

b = [M ; 0 ; 0 ;  0 ; 0 ; F ; -q1*L2^4/(120*EI2) ; q1*L2^2/6+cT*q1*L2^3/(24*EI2)] ;   

C = A \ b ;

n  = 2500 ;
zi = 0 : (L1+L2)/n : L1+L2 ;
v  = zeros(n+1,1) ;
Mb = zeros(n+1,1) ;
FQ = zeros(n+1,1) ;

for i=1:n+1
   if zi(i) <= L1
       z     = zi(i) ;
       v(i)  = (C(1)*z^3/6+C(2)*z^2/2+C(3)*z+C(4)) ;
       Mb(i) = -EI1*(C(1)*z+C(2)) ;
       FQ(i) = -EI1*C(1) ;
   else
       z     = zi(i)-L1 ;
       v(i)  = (q1*z^5/(120*EI2*L2)+C(5)*z^3/6+C(6)*z^2/2+C(7)*z+C(8)) ;
       Mb(i) = -EI2*(q1*z^3/(6*EI2*L2)+C(5)*z+C(6)) ;
       FQ(i) = -EI2*(q1*z^2/(2*EI2*L2)+C(5)) ;
   end
end

subplot (3,1,1) ; plot (zi , v)  , grid on , title ('Biegelinie') , axis ij
subplot (3,1,2) ; plot (zi , Mb) , grid on , title ('Biegemoment')
subplot (3,1,3) ; plot (zi , FQ) , grid on , title ('Querkraft')

vLinks     = v (1)
vGelenk    = v (round(n*L1/(L1+L2))+1)
MbRechts   = Mb(n+1)
Fc2        = c2*vGelenk