clear all
close all
clc

run('par.m');
% Versuch1
t = [0 10]; 
x0=[0;0;0;0;0]; 
opts = odeset('RelTol',1e-6,'AbsTol',1e-6); 
[t,phi] = ode45(@(t,x) model_2(t,x,p),t,x0,opts);


figure (1)

hold on
plot (t,phi(:,2),'linewidth',1.2,'DisplayName','phi 1')
plot (t,phi (:,3),'linewidth',1.2,'DisplayName','phi 1 punkt')
plot (t,phi (:,4),'linewidth',1.2,'DisplayName','phi 2')
plot (t,phi (:,5),'linewidth',1.2,'DisplayName','phi 2 punkt')
grid on
title ('Simulation Versuch 3')
xlabel ('T[ms]')
ylabel ('Amplitude [{\circ}]')
legend ('?DynamicLegend');

%Versuch 2
t = [0 6]; 
x0 = [0;0;0;0;0];
opts = odeset ('RelTol',1e-6, 'AbsTol',1e-6);
[t,phi] = ode45(@(t,x) modell_1(t,x,p), t, x0, opts);

figure (2)

plot (t,phi(:,1),'linewidth',1.2,'DisplayName','i')
hold on
plot (t,phi(:,2),'linewidth',1.2,'DisplayName','phi 1')
plot (t,phi(:,3),'linewidth',1.2,'DisplayName','phi 1 punkt')
plot (t,phi(:,4),'linewidth',1.2,'DisplayName','phi 2')
plot (t,phi(:,5),'linewidth',1.2,'DisplayName','phi 2 punkt')

grid on 
title ('Simulation Versuch 3')
xlabel ('T[ms]')
ylabel ('Amplitude [{\circ}]')
legend ('?DynamicLegend');