%% Simulation Zweimasseschwinger bei Weganregung
%
%Start.m
%f.m
%
%25.11.2014
%Thomas Schmid


%% Funktionsdeklaration

function xp=f1(t1,x)

%% Variablendeklaration

global m1 m2 c1 c2 d1 d2
global x0 x0p

%% Parameter

x1=x(1);x2=x(2); v1=x(3); v2=x(4);

%% Differentialgleichungssystem

x1p = v1;
x2p = v2;
v1p = (1/m1)*(-(d1+d1)*v1-(c1+c2)*x1+d2*v2+c2*x2+d1*x0p+c1*x0) ;
v2p = (1/m2)*(-d2*(v2-v1)-c2*(x2-x1)) ;

xp = [x1p;x2p;v1p;v2p];

