%===============================================
%  Skizziere Richtungsfeld  von
%
%       y' = f(t,y)
%===============================================
close all

f = @(t,y) log(t.^2 + y.^2)

a = 0.1; b = 2;  % (t,y) interval
n =20;  %  number of points
h = (b-a)/n;  %  mesh size

t = a:h:b;   % discrete t-values
y = a:h:b;   % discrete y-values

[T,Y] = meshgrid(t,y);

Z = f(T,Y);
Znorm = sqrt(1+Z.^2);
ONES = 0*Z +1;

quiver (T,Y, ONES./Znorm,  Z./Znorm,  0.6,'b')

[sx,sy] = meshgrid(a:4*h:b, a:4*h:b);  %  starter points
h = streamline(T,Y,   ONES, Z, sx,sy);
set(h,'Color','red')

xlabel('t-axis')
ylabel('y-axis')

title('Richtungsfeld und Lösungen:    dy/dt = log(t^2+y^2)','FontSize',14)

