# NAME    :- IBRAR AHMAD 
TUTORIAL:- GROUP 5TH   
ROLL NO :- 11232225    
DATE    :- 9-4-2013    

Basic Battle Model (Both uces Aimed Firing)

kill(all)$ depends ([R,B],t)$
'a1=a1:.0544;'a2=a2:0.0106;
eqn1:'diff(R,t)=-a1*B;
eqn2:'diff(B,t)=-a2*R;
points:rk([rhs(eqn1),rhs(eqn2)],[R,B],[66,18],
[t,0,30,.1])$
[%[1],last(%),length(%)];
xR:makelist([points[i][1],points[i][2]],i,1,
length(points))$
[%[1],last(%),length(%)];
yB:makelist([points[i][1],points[i][3]],i,1,
length(points))$
wxplot2d([[discrete, xR],[discrete,yB]],[x,0,30],
[style,[lines,2],[lines,3]],[y,0,70],
[ylabel,"Soldiers"],[xlabel,"t days"],
[legend,"R(t) Red Army","B(t)Blue Army"]);

:Both Uses Random Fire

kill(all)$ depends ([R,B],t)$
'a1=a1:.0544;'a2=a2:0.0106;
eqn1:'diff(R,t)=-a1*B*R;
eqn2:'diff(B,t)=-a2*R*B;
points:rk([rhs(eqn1),rhs(eqn2)],[R,B],[66,18],
[t,0,30,.1])$
[%[1],last(%),length(%)];
xR:makelist([points[i][1],points[i][2]],i,1,
length(points))$
[%[1],last(%),length(%)];
yB:makelist([points[i][1],points[i][3]],i,1,
length(points))$
wxplot2d([[discrete, xR],[discrete,yB]],[x,0,30],
[style,[lines,2],[lines,3]],[y,0,70],
[ylabel,"Soldiers"],[xlabel,"t days"],
[legend,"R(t) Red Army","B(t)Blue Army"]);

Jungle Warfare(One Uses  Aimed Fire And Other Random Fire

kill(all)$ depends ([R,B],t)$
'a1=a1:.0544;'a2=a2:0.0106;
eqn1:'diff(R,t)=-a1*B;
eqn2:'diff(B,t)=-a2*R*B;
points:rk([rhs(eqn1),rhs(eqn2)],[R,B],[66,18],
[t,0,30,.1])$
[%[1],last(%),length(%)];
xR:makelist([points[i][1],points[i][2]],i,1,
length(points))$
[%[1],last(%),length(%)];
yB:makelist([points[i][1],points[i][3]],i,1,
length(points))$
wxplot2d([[discrete, xR],[discrete,yB]],[x,0,30],
[style,[lines,2],[lines,3]],[y,0,70],
[ylabel,"Soldiers"],[xlabel,"t days"],
[legend,"R(t) Red Army","B(t)Blue Army"]);