RAST I MIROVANJE

Graf P(t), S(t), Q(t)

Slika 4-4a  	4-4b	4-4c

Clear[v,k,y,a1,k1,a2,k2,p,s,q];
v=1;
k=1;
y=0.99;
a1=1;
k1=1;
a2=1;
k2=1;
xend=20;
eq=NDSolve[{
s'[x]==-v s[x]/(k+s[x])p[x]/y,
p'[x]==v s[x]/(k+s[x])p[x]-a1/(k1+s[x]) p[x]+ a2 s[x]/(k2+s[x]) q[x], 
q'[x]==a1/(k1+s[x]) p[x]- a2 s[x]/(k2+s[x]) q[x],
p[0]==0.02,s[0]==2,q[0]==0.01},{p[x],s[x],q[x]},{x,0,xend}];
p[x_]=N[p[x]]/.eq;
s[x_]=N[s[x]]/.eq;
q[x_]=N[q[x]]/.eq;
g1=Plot[s[x],{x,0,xend},PlotRange->{0,2.1},AspectRatio->0.4,FrameLabel->{"Vrijeme"," S(t)"},Frame->{True,True,False,False},FrameStyle->{Directive[12,Thickness[0.004]],Directive[12,Thickness[0.004]]},PlotStyle->{{Red,Thickness->0.005},{Green,Thickness->0.005}}]
g2=Plot[p[x],{x,0,xend}, PlotRange->{0,2.1},AspectRatio->0.4,FrameLabel->{"Vrijeme"," P(t)"},Frame->{True,True,False,False},FrameStyle->{Directive[12,Thickness[0.004]],Directive[12,Thickness[0.004]]},PlotStyle->{{Blue,Thickness->0.005},{Green,Thickness->0.005}}]
g3=Plot[q[x],{x,0,xend}, PlotRange->{0,2.1},AspectRatio->0.4,FrameLabel->{"Vrijeme"," Q(t)"},Frame->{True,True,False,False},FrameStyle->{Directive[12,Thickness[0.004]],Directive[12,Thickness[0.004]]},PlotStyle->{{Blue,Thickness->0.005},{Green,Thickness->0.005}}]

n[x_]=p[x]+q[x];
g4=Plot[n[x],{x,0,xend}, PlotRange->{0,2.1},AspectRatio->0.4,FrameLabel->{"Vrijeme"," P(t)+Q(t)"},Frame->{True,True,False,False},FrameStyle->{Directive[12,Thickness[0.004]],Directive[12,Thickness[0.004]]},PlotStyle->{{Blue,Thickness->0.005},{Green,Thickness->0.005}}]