function [] = myLorenz()
% Anfangs und Endzeitpunkt
t0 =   0.00;
dt =   0.01;
t1 =   20.0;

% Startwerte
x0 = 1;
y0 = 1;
z0 = 1;

[T,Y] = ode113(@myFun,[t0:dt:t1],[x0 y0 z0]);

for i=1:length(T)
    plot3(Y(1:i,1), Y(1:i,2), Y(1:i,3)); grid on;
    xlim([-20 20]); ylim([-40 40]); zlim([0 50]);
    view(-34,34);
    pause(0.001);
end


% figure; plot3(Y(:,1), Y(:,2), Y(:,3)); grid on;

end


function dY = myFun(t,Y)
% Konstanten
    a = 10;
    b = 28;
    c = 8/3;

% Nichtlineare DGL
    dY = zeros(3,1);
    dY(1) = a * (Y(2)-Y(1));
    dY(2) = Y(1)*(b-Y(3)) - Y(2);
    dY(3) = Y(1)*Y(2) - c*Y(3);
end


