function [t,j] = tema1_func(h)
% funcion para resolver EDO en test 2, tema 1, 521230, S2-2012
% mediante euler implicito

% N = ceil(1/h);
% h = 1/N;

N = 1/h;
R = 0.02;
r = 0.02;
L = 0.0001;

j = zeros(N+1,1);

c = 1+h*r*R/L/(r+R);

for i = 2:N+1
    b = j(i-1)-h/L*sin((i-1)*100*h);
    j(i) = b/c;
end

t = 0:h:1;


