function BolzenkraefteEv2

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

phi0 = [asin(1/3) ; 0] ; tspan = [0 2] ;                         % Anfangswerte, Zeitintervall
options = odeset ('MaxStep' , 0.01) ;

[t phiphip] = ode45 (@Dgl , tspan , phi0 , options) ;
phi = phiphip(:,1) ; phip = phiphip(:,2) ;                       % Sortieren der Ergebnisse
xS  = 0.5*cos(phi) ; yS  = 0.5*sin(phi)  ;                       % Mittelpunkt der Verbindungsstange
x2S = cos(phi)     ; y1S = sin(phi)      ;                       % Gleitsteine

subplot(1,3,1) ; plot (t  , x2S) , grid on , title  ('x_2^{\ast}(t)')
subplot(1,3,2) ; plot (t  , y1S) , grid on , title  ('y_1^{\ast}(t)')
subplot(1,3,3) ; plot (xS , yS ) , grid on , title  ('y^{\ast}(x^{\ast})') , axis equal

% ============================================================
% 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] ;