function Bolzenkraefte

global JSS          m1S         m2S       gS 
       JSS = 1/12 ; m1S = 0.5 ; m2S = 2 ; gS = 29.43 ;

maxstep = 0.001 ;
phi0 = [asin(1/3) ; 0] ; tspan = [0 2] ;          % Anfangswerte, Zeitintervall
options = odeset ('MaxStep' , maxstep) ;          % Integration des AWPs: 
[t phiphip]  = ode45 (@Dgl , tspan , phi0 , options) ;

phi   = phiphip(:,1) ; phip = phiphip(:,2) ;      % Sortieren der Ergebnisse
zaehl = -((m2S-m1S)*(phip.^2).*sin(2*phi)+(2*m1S+1)*gS*cos(phi)) ;
nenn  =  (0.5+2*m2S*(sin(phi)).^2+2*m1S*(cos(phi)).^2+2*JSS) ;
phipp =  zaehl./nenn ;
xppS  = -(phipp.*sin(phi)+(phip.^2).*cos(phi))/2 ;
yppS  =  (phipp.*cos(phi)-phip.^2.*sin(phi))/2 ;
x2ppS = -(phipp.*sin(phi)+phip.^2.*cos(phi)) ;
y1ppS =  (phipp.*cos(phi)-phip.^2.*sin(phi)) ;
F1xS  =  (xppS+m2S*x2ppS)/gS ;
F1yS  =   m1S+m1S*y1ppS/gS ;
F2xS  =   m2S*x2ppS/gS ;
F2yS  =   1+yppS/gS+m1S+m1S*y1ppS/gS ;
F1S   = sqrt(F1xS.^2+F1yS.^2) ;
F2S   = sqrt(F2xS.^2+F2yS.^2) ;

subplot(2,2,1) ; plot (t , phi)  , grid on , title  ('\phi(t)')
subplot(2,2,3) ; plot (t , phip) , grid on , title  ('\omega(t)')
subplot(2,2,2) ; plot (t , F1S)  , grid on , title  ('F_1^{\ast}(t)')  
subplot(2,2,4) ; plot (t , F2S)  , grid on , title  ('F_2^{\ast}(t)')

disp([' ']) ;
disp(['Rechnung mit MaxStep = ' , num2str(maxstep) , ':']) ;
disp(['phi  (t_end = ' , num2str(t(end)) , ') = ' , num2str(phi(end))]) ;
disp(['omega(t_end = ' , num2str(t(end)) , ') = ' , num2str(phip(end))]) ;

% ============================================================
% Function, die die "rechte Seite" des Dgl.-Systems definiert: 
function f = Dgl (t , phiphip)

global JSS          m1S         m2S       gS 

phi   = phiphip(1) ;
omega = phiphip(2) ;

phiP  = omega ;
zaehl = -((m2S-m1S)*omega^2*sin(2*phi)+(2*m1S+1)*gS*cos(phi)) ;
nenn  =  (0.5+2*m2S*(sin(phi))^2+2*m1S*(cos(phi))^2+2*JSS) ;

f = [phiP ; zaehl/nenn] ;