function hh = pp_euler (hamso,x,is_plot,new_plot)
	%
    if (nargin <3) || isempty(is_plot)
        is_plot=0;
    end;
    if (nargin > 3) && ~isempty(new_plot) && (new_plot==1)
        figure();
    end;
    
 	h=diff(x);
    [nouse g]=feval(hamso,x,0);
	y0=g(1)
    %y0=-5
    k1=zeros(size(x));
%    k1=[];
    print_tieude(12)
    
	for ii=2:length(x)
       [y0(ii) nouse k1(ii-1)]=pp_euler_1b(hamso,x(ii-1),y0(ii-1),h(ii-1));
       str_print = sprintf('| %10.5f | %3.1f | %10.5f | %10.5f |', ...
		x(ii-1),h(ii-1),k1(ii-1),y0(ii));
       disp(str_print)
	end;
	if is_plot
		hhh(1)=plot(x,g,'k-','LineWidth',3);
		hold on;
        hh(2:3)=plot(x,y0,'rx',x,y0,'r:','LineWidth',3);
		grid on;
	end;
%
function [f, g, k1]=pp_euler_1b(hamso,x0,y0,h)
	%
    [k1 g]=feval(hamso,x0,y0);
	f = y0 + h*k1;
 
function print_tieude(max_len)
    minus_str(1,1:(max_len*3+5+5))='-';
    disp(minus_str);
    str=printstr('x0',max_len);
    str=['|' str '|'];
    str=[str printstr('h',5) '|'];
    str=[str printstr('k1=f(x0,y0)',max_len) '|'];
    str=[str printstr('y1=y0+h*k1',max_len) '|'];
    disp(str);
    disp(minus_str);
    
