clear, close all, clc; disp(['Walzprozess',date])
global a b C ha hb Jw Jz Jges mW mZ mges k r1 r2 s0 tspan ys rho B Z
% Konstanten
a=B/2 + Z/2; % Bandmitte - Zapfenmitte [m]
b=0.8; % Bandbreite [m]
C=1850000000; % Geruestmodul [N/m]
Jw=1/4*mW*r1^2+1/12*mW*B^2
Jz=1/4*mZ*r2^2+2*mZ*((B)/2+(Z)/2)^2
Jges=Jw+2*Jz+2*mZ*((B)/2+(Z)/2)^2
mW=pi*r1^2*B*rho %Ballenmasse [kg]
mZ=pi*r2^2*Z*rho %Zapfenmasse [kg]
mges=mW+2*mZ
k=190000000; %Umformwiderstand [N/m^2]
r1=0.5; %Ballenradius [m]
r2=r1/1.5; %Lagerzapfenradius [m]
s0=0.02; %Voreinstellung [m]
rho=7865; %Dichte von Stahl [kg/m^3]
B=b*2; %Ballenbreite
Z=b/1.5; %Zapfenbreite
%Eingangsparameter
tspan=[0;3]
ys=[0;0;0;0];
%DGL Lösen
options=odeset('OutputFcn',@odeplot,'OutputSel',[1 3]);
[t,x]=ode23(@ma,tspan,ys,options);
%Ausgabe der Ergebnisse
figure, nor=1e+3;
subplot(2,1,1),plot(t,x(:,1)*nor),xlabel('t in [s]'),ylabel('Auffederung in [mm]')
subplot(2,1,2),plot(t,x(:,3)),xlabel('t in [s]'),ylabel('Winkel in [rad]')

