close all

global qhp qcp  beta mup mum alpha1 alpha2 alpha3 alpha4 alpha5 qcm qhm d ...
    a21 a31 a41 a51 a12 a32 a42 a52 a13 a23 a43 a53 a14 a24 a34 a54 a15 a25 a35 a45

qhp = 3;
qcm = 2;
qcp = 1;
qhm = 1;
beta = 0.4;
mup = 0.3;
mum = 0.3;
alpha1 = 0.7;
alpha2 = 0.6;
alpha3 = 0.5;
alpha4 = 0.4;
alpha5 = 0.3;
d = 1.2;

    a21 = 0.3;
    a12 = 0.3;
    a31 = 0.3;
    a13 = 0.3;
    a41 = 0.3;
    a14 = 0.3;
    a15 = 0.3;
    a51 = 0.3;
    a23 = 2.2;
    a32 = 2.2;
    a42 = 2.2;
    a24 = 2.2;
    a25 = 2.2;
    a52 = 2.2;
    a34 = 2.2;
    a43 = 2.2;
    a53 = 2.2;
    a35 = 2.2;
    a54 = 2.2;
    a45 = 2.2;

p0 = 0.2;
m10 = 0.4;
m20 = 0.02;
m30 = 0.04;
m40 = 0.03;
m50 = 0.05;

Tfin = 200;


options = odeset('RelTol',1e-4,'AbsTol',1e-6);
[T,Y1] = ode45(@eq_w, 0:.1:Tfin, [p0; m10; m20; m30; m40 ; m50], options);

figure
%subplot(1,2,1)
plot(T,Y1(:,1),'green',T,Y1(:,2),'black', T,Y1(:,3),'m', T,Y1(:,4),'r', T,Y1(:,5),'c', T,Y1(:,6),'blue','Linewidth',2)
%axis([0 50 0 8])
legend({'Plant', 'Fungus 1', 'Fungus 2','Fungus 3','Fungus 4','Fungus 5'}, 'Location','best', 'FontSize',12)
xlabel('time')
ylabel('Biomass')
title('1 plant, X fungi')
set(gca,'fontsize',14)


