function ss_30genes();
n=30;
alpha=ones(n,1);
beta=ones(n,1);
g=zeros(n,n);
h=zeros(n,n);
g(1,14)=-0.1;
g(5,1)=1.0;
g(6,1)=1.0;
g(7,2)=0.5;
g(7,3)=0.4;
g(8,4)=0.2;
g(8,17)=-0.2;
g(9,5)=1.0;
g(9,6)=-0.1;
g(10,7)=0.3;
g(11,4)=0.4;
g(11,7)=-0.2;
g(11,12)=0.4;
g(12,16)=0.5;
g(13,8)=0.6;
g(14,9)=1.0;
g(15,10)=0.2;
g(16,11)=0.5;
g(16,22)=-0.2;
g(17,13)=0.5;
g(19,14)=0.1;
g(20,26)=0.3;
g(20,15)=0.7;
g(21,16)=0.6;
g(22,23)=0.1;
g(23,17)=0.2;
g(24,15)=-0.2;
g(24,18)=-0.1;
g(24,19)=0.3;
g(25,20)=0.4;
g(26,21)=-0.2;
g(26,28)=0.1;
g(27,30)=-0.2;
g(27,24)=0.6;
g(27,25)=0.3;
g(28,25)=0.5;
g(29,26)=0.4;
g(30,27	)=0.6;
for i=1:n
    h(i,i)=1;
end
p0=[ 1.90025857029435e+000
    115.782609568537e-003
    1.67623689010477e+000
    993.104899406206e-003
    1.58964216040185e+000
    1.16558336312246e+000
    830.749720886445e-003
    1.36666464867697e+000
    1.21708072244798e+000
    242.094226072829e-003
    879.581713892760e-003
    274.019783415240e-003
    594.811357918519e-003
    387.786359969336e-003
    1.43308479450010e+000
    720.622341839560e-003
    1.46530129825879e+000
    1.34000772978736e+000
    1.62423563771936e+000
    375.720960995525e-003
    571.878464794397e-003
    1.65772895252185e+000
    443.816159081057e-003
    418.543281324889e-003
    1.19582652321025e+000
    29.7286749270373e-003
    1.07920221174597e+000
    148.579218188163e-003
    1.50804533170763e+000
    362.632657741391e-003];
tspan = [0:0.2:2];
[t,p] = ode15s(@ode_ssys, tspan, p0,[],alpha,beta,g,h);
figure(1);
for (i=1:10)
    subplot(5,2,i)
    plot(t,p(:,i),'bs-');
    ylabel(['X' int2str(i)])
end
figure(2);
for (i=11:20)
    subplot(5,2,i-10)
    plot(t,p(:,i),'bs-');
    ylabel(['X' int2str(i)])
end
figure(3);
for (i=21:30)
    subplot(5,2,i-20)
    plot(t,p(:,i),'bs-');
    ylabel(['X' int2str(i)])
end

function dp = ode_ssys(t,X,alpha,beta,g,h);
dp = zeros(30,1);   
for i=1:30   
  vplus=alpha(i); 
  for j=1:30
     vplus=vplus*X(j)^g(i,j);
  end
  vminus=beta(i);  
  for j=1:30
     vminus=vminus*X(j)^h(i,j);
  end
  dp(i)=vplus-vminus;
end
