Q5.3-18E
Question
Combat Model. A simplified mathematical model for conventional versus guerrilla combat is given by the system where and are the strengths of guerrilla and conventional troops, respectively, and 0.1 and 1 are the combat effectiveness coefficients. Who will win the conflict: the conventional troops or the guerrillas? [Hint: Use the vectorized Runge–Kutta algorithm for systems with h=0.1 to approximate the solutions.]
Step-by-Step Solution
VerifiedThe solution is convention loop will win.
Write the equation as and
The initial conditions are:
For the solution, apply the Runge-Kutta method in Matlab for h=0.1.
Now the algorithm is:
Function n[t,x] = Runge_Kutta(f,t0,t_end,init_cond,h)
%we begin at time t0 and end when we reach t_end
%init_cond(i) contains the initial value of x_i
%f contains functions such that x_i'=f_i(t,x1,x2,...)
t(:,1)=t0; % t0 is the initial value of t
x(:,1)=init_cond; % initial conditions are set
i=1;
while t(:,i) < t_end
k1=f(t(i),x(:,i));
k2=f(t(i)+0.5*h,x(:,i)+0.5*h*k1);
k3=f(t(i)+0.5*h,x(:,i)+0.5*h*k2);
k4=f(t(i)+h,x(:,i)+h*k3);
x(:,i+1)=x(:,i)+(h/6)*(k1+2*k2+2*k3+k4);
t(:,i+1)=t(:,i)+ h;
i=i+1;
end
Now for the solution
clear all
init_cond=[10;15];
f=@(t,X) [-0.1*X(1)*X(2);-X(1)];
[t,x] = Runge_Kutta(f,0,10,init_cond,0.1);
plot(t,x(1,:),t,x(2,:));
legend('guerilla','conventional')
Therefore, the convention loop will win.