pro oscillation

;finds rate constants for oscillating solutions of the 3-state ring model

incr=0.1

lk1=(dindgen(20)+1.)*incr

lk2=(dindgen(20)+1.)*incr

lk3=(dindgen(20)+1.)*incr

lk4=(dindgen(20)+1.)*incr

k5=1.

k6=0.1

sum=dblarr(20,20,20,20)

tot=dblarr(20,20,20,20)

for i=0,19 do begin

k1=lk1(i)

for j=0,19 do begin

k2=lk2(j)

for k=0,19 do begin

k3=lk3(k)

for l=0,19 do begin

k4=lk4(l)

;k6=k1*k3*k5/k2/k4

sum(i,j,k,l)=k1+k2+k3+k4+k5+k6

tot(i,j,k,l)=k2*k6+k3*k6+k3*k1 + k6*k4+k1*k4+k1*k5 + k2*k4+k2*k5+k3*k5

di=sum(i,j,k,l)^2-4*tot(i,j,k,l)

if di lt -5. then print,'k1,k2,k3,k4: ',k1,k2,k3,k4, '. dis',di

endfor

endfor

endfor

endfor

;dis=sum^2-4*tot

;print,min(dis)

stop

end