%om=0.5;
%R=0.5;
%kr=[0.01:0.01:2];
%ki=[-0.3:0.01:0.3];
%[kkr,kki]=meshgrid(kr,ki);
%kk=kkr+i*kki;
%rdd=brok(kk,om,R);
%figure;
%contour(kkr,kki,real(rdd),[0 0])
%hold on;
%contour(kkr,kki,imag(rdd),[0 0])

figure(1); hold on;
figure(2); hold on;
RR=[0.5:0.05:1.05];
%RR=[0.5];
for l=1:length(RR)
R=RR(l);
om=[0.01:0.005:0.7];
a=om;
a(49)=0.5-0.1*i;
for j=50:length(om) a(j)=fsolve(@(k) brok(k,om(j),R), a(j-1)); end;
for j=49:-1:1  a(j)=fsolve(@(k) brok(k,om(j),R), a(j+1)); end;
figure(1);plot(om,-imag(a));
hold all;
xlabel('\omega');
ylabel('-k_i');
figure(2);plot(om,real(a));
hold all;
xlabel('\omega');
ylabel('k_r');
%figure(3);
%plot(1+R*tanh([-5:0.01:5]),[-5:0.01:5]);


end;