Battles in relation to calculus


By Brad Rodgers (P1930) on Friday, July 14, 2000 - 02:41 am :

If two warring factions are given two different amounts of men, one (tribe A) 2m ,and the other(tribe B) m, and each set of men are trained equally well. What amount of men will tribe A end up with once tribe B is entirely gone (assuming that all fighting is continuous). The intuitive response would be 1.5m, but I think this is wrong as after a given amount of time the ratio would be less than 1/2. How can we do this problem.

Thanks,

Brad


By Dan Goodman (Dfmg2) on Friday, July 14, 2000 - 02:50 am :

It really depends on how they're fighting. There was a program on TV the other day about someone who modelled this problem. His take was that with hand to hand weapons, the rate of loss of men would be constant, but that with long range weapons (guns, cannons, etc.)the rate of loss of men would be proportional to the size of the other army, from which you can set up a differential equation. Unfortunately, I wasn't watching the program very closely, so I don't know why he came up with those models.


By Brad Rodgers (P1930) on Friday, July 14, 2000 - 07:08 pm :

While far from being anything rigorous, I had a computer program run some tests on this. As a general result (the results were varied because my men had a only probability of aiming each shot correctly), when one group has 2x the other groups men, about 8/9 of their men will live after the battle is over. If they have only 4/3x though, they number of casualties (for the larger group) rises to the level of about 9/20 the total amount of men started with.

Are these anything close to what results the mathematician came up with, if you can remember?


By Dan Goodman (Dfmg2) on Monday, July 17, 2000 - 01:34 am :

I don't remember the TV programme well enough to say I'm afraid, but we can have a go at constructing a model ourselves without too much difficulty. If we assume that army 1 has N men and army 2 has M men, that each man has a gun and will kill k people per second (on average). This gives us dM/dt=-kN and dN/dt=-kM. Unfortunately, my brain has given out completely, and I can't remember how to solve this system of differential equations (oh the shame!). Anyway, clearly the parameter k is how well trained the army is, and you could make the armies have different training by saying dM/dt=-k1 N and dN/dt=-k2 M. I'll try and work out the solution to this differential equation and write back.


By Dan Goodman (Dfmg2) on Monday, July 17, 2000 - 02:27 am :

After some laborious calculations (I worked out the method for solving these equations), I have the general solution for the second differential equation. For the special case of the first differential equation, the "training factor" k doesn't matter (not too surprising), and if M0 =cN0 with c> 1, then after the battle the M-army will be sqrt(c2 -1)/c of it's original size. For your examples, this gives sqrt(3)/2=0.866 if c=2 and sqrt(7)/4=0.661 if c=4/3. If you want the general solution (and method) I could write it out, but it's quite long (especially the method!), and the method involves eigenvalues and eigenvectors, do you know about these?


By Dan Goodman (Dfmg2) on Monday, July 17, 2000 - 02:29 am :

This doesn't seem to quite agree with your computer program, how did it work?


By Simon Judes (P2636) on Monday, July 17, 2000 - 01:30 pm :

For the case with k1 =k2 , you can just add the two equations, and subtract them to get two uncoupled equations in the variables a=M+N, and b=M-N, which are easy to solve.
For the case with k1 and k2 different, differentiate one equation with respect to t, and substitute in the other. You'll get an uncoupled 2nd order DE, which will give you some incorrect solutions.
The easiest method is to take the Laplace transforms of both sides, which will turn coupled DEs into simultaneous equations. Solve these, and then take the inverse transform.


By Michael Doré (P904) on Tuesday, July 18, 2000 - 12:58 am :

I would have thought that dN/dt must depend on N as well as M. Possibly even be directly proportional. (If there are double the people it might seem reasonable to imagine that each has an constant chance of being killed compared to before.) But actually maybe not, because that would imply that the death rate of the two armies were equal which is patently not always true. The problem is that if there are more men on one side the death rate of that same side will increase but not in direct proportion because the extra men gives the first side a tactical advantage so the chance of each individual getting killed is lowered.

But I don't think it is safe to assume that dN/dt is only dependent on M - while there are 1000 people on the N side then there will be more deaths per second than if the N-army is reduced to a single man!

Michael


By Brad Rodgers (P1930) on Saturday, July 22, 2000 - 06:12 am :

My computer program probably wasn't that accurate, in order to end up with halfway accurate results I had to give each man a probabilty of being able to hit their target, and if they missed their target they still stood a chance of hitting another man (something I had not thought of until Michael's post), and each man had a resistance of 2 bullets. So I suppose that probably wasn't the most accurate device to test by (it was just a videogame-probably not made for too accurate of calculations), but the result of .866 is fairly close to 8/9. And even .661 is only a little over a tenth away from 11/20.

Anyways, I would like to hear your logic, but I really don't have any idea what eigenvalues and eigenvectors are. Maybe just learning what these are will be enough to be able to figure the method out on my own.

I think you may be right about the men being able to kill more people when the other group is larger, Michael, altough I'm not sure that this can even be included in a calculation as it would largely rely upon probability. Perhaps if the men are not fighting in any sort formation and were spread out enough (such as in WWII or a staggered formation), this would be negligable. You could probably even write up an even more complex system of differential equation with this included. Assuming that all men are the same size (*and if an army has probility p of hitting a man and another army is of size 1/p, one of their men will be killed-this can be generalised to 1/xp-*) , this equation seems to work out

dM/dt=-kbNM

dN/dt=-kbMN

Where b is an unknown constant

this of course shows that the rate is the exact same, so each time (if this was true) there would be |M-N| men left after the fighting has ceased. This leads me to believe that the above ** statement is wrong. Maybe we could just neglect this for now, unless anyone has any suggestions on how to solve it...

Brad


By Dan Goodman (Dfmg2) on Friday, July 28, 2000 - 03:58 am :

The eigenvalue/eigenvector method of solving coupled differential equations is quite complicated, and I don't think I'll go into it here. For the case k1 =k2 , it's probably best to use Simon's method, he's a physicist, they're good at solving differential equations :) Oops, I might be in trouble for that ;P. Do you think the following set of equations is enough to solve this problem?

dM/dt = aM+bN+c
dN/dt = dM+eN+f

For some set of constants a,b,c,d,e,f. Or do you think that higher powers or other functions might make an appearance? One that occurs to me is that M/N and N/M might both make an appearance, although I don't see that MN should make an appearance.

Here is another go at constructing a (simple) model, the armies consist of N,M men respectively. We'll assume that each man in their respective army is equally well trained, but not that both armies are equally well trained. We'll also ignore strategic considerations, the model will assume that there is a big clash between two armies in a big field, say. (Of course, it would also be interesting to model the strategic element, any ideas of how to go about doing this?). Each man in the N-army (for instance) has a probability p of hitting his target. If he missed his target, he has a probability q of hitting someone else. What can we assume about p and q? I think that it would be safe to assume that p is constant, and depends on how well trained he is. q might depend on how many men are in the other army however, because as there are less and less people in the other army, the chance of hitting someone else if you miss your target decreases (to 0 if there is only person on the opposing army). Let's say that q=f(M) and f(1)=0 and f(M)< 1 for all M. If we further assume that the firing rate for each soldier is constant, say once every k seconds, then we get the following equation for M(t)

M(t+k)=M(t)-N(p+(1-p)f(M))

and similarly for N(t). If we now call the armies N1 and N2 , the probability of hitting the enemy target p1 and p2 , the firing rate k1 and k2 , the probability of hitting another target assuming you missed your primary target f1 (N2 ) and f2 (N1 ), we get the following differential equations to solve:

k1 dN2 /dt = N2 - N1 p1 + (1-p1 )N1 f1 (N2 )
k2 dN1 /dt = N1 - N2 p2 + (1-p2 )N2 f2 (N1 )

Any comments on what form the functions fi might take, and whether this model is appropriate or not?


By Brad Rodgers (P1930) on Saturday, July 29, 2000 - 11:36 pm :

The logic used to formulate the equations seems to be right, yet, it ,might be hard to come up with a nice and neat formula to represent f(M), as this would be dependent in the way that group M is fighting, and how much group N would miss by. It's somewhat obvious, but if N only misses up to 2 feet, and the men in group M are spread out 6 feet between each man, then q is zero. Furthemore, f(M) would change as the distance between the groups change. But, p would change as well as the distance decreased. I think it could be possible to define the total prob. as

p+(1-p)f(M)=m/( π× r2 )

where m is the area of troops to be found in the shooting radius( π× r2 ). It wouldn't be toohard to use trigonometry to find what the shooting radius is in relation to distance

(π×(tan(θ)d )2 , for d= distance, and θ=angle of missing). I don't know whether it would be wise to assume that the people are moving or not, but it will be much harder to figure with moving people.

Perhaps we could circumnavigate m by saying it is a constant - the men move in once one man is dead.

Brad


By Brad Rodgers (P1930) on Saturday, July 29, 2000 - 11:47 pm :

Also, could someone give me a few more details on Simon's method, I'm not sure I entirely understand what to do.

Here's what I did:

dM+dN/dt=-k(N+M)

N+M=a

dt/da=-1/ka

-tk=lna

N+M=1/etk

Obviously, something's wrong, but what?


By Dan Goodman (Dfmg2) on Sunday, July 30, 2000 - 12:31 am :

OK, Simon's method:

dM/dt=-kN (1)
dN/dt=-kM (2)

(1)+(2):
d(M+N)/dt=-k(M+N)

Let S=M+N

dS/dt=-kS
dS/S=-kdt
log(S)=-kt+C some constant C
S=Ce-kt some positive constant C.

M+N=Ce-kt (3)

(1)-(2):
d(M-N)/dt=k(M-N)

Let R=M-N
dR/dt=kR
R=Dekt some positive D.

M-N=Dekt (4)

(1/2)((3)+(4)):
M = (1/2)(Ce-kt +Dekt )

Similarly for N, now use boundary conditions at t=0, i.e. M=M0 and N=N0 and dM/dt=-kN0 and dN/dt=-kM0 to solve for C and D.

The reason it may seem like something is wrong, is because once M or N becomes 0, the differential equation ceases to apply, so the fact that N+M tends to 0 as t tends to infinity is not a contradiction, because you are extending the solution outside the valid domain.


By Simon Judes (P2636) on Wednesday, August 2, 2000 - 12:25 am :

A thought occurred to me: given the simplicity of the battleground situation (i.e. no tactics), it might be that a very simple model works for large values of N and M.
When N and M are both small, perhaps < 30 I'd guess, there is little point in trying to model things by differential equations at all - because the approximation of continuity is poor. Remember that in real life, they aren't continuous variables; half a soldier doesn't fight half as effectively as a whole one. Absurd results as N and/or M go to 0 would not be surprising.

When one army is substantially better or more numerous than the other, the situation is more hopeful for a simple model. As Dan points out, the physicist in me might be getting in the way of better judgement, - I remember a joke whose punch line is the physicists request to "consider the spherical horse in a vacuum".

So, if you do want to use more complicated DEs, especially with N/M and M/N, then unless you end up with a standard form, Laplace transforms are definitely the way to go.


By Dan Goodman (Dfmg2) on Wednesday, August 2, 2000 - 12:49 am :

Simon, could you tell me what a Laplace transform is? I'm reasonably well acquainted with Fourier transforms and some of their properties, but not Laplace transforms.


By Simon Judes (P2636) on Wednesday, August 2, 2000 - 11:59 pm :
I can't give you any rigor on this, but essentially, they are just a real version of Fourier transforms, i.e. the Laplace transform of a function f(x) is: F(p)= 0 f(x)exp(-px)dx

The differences from the fourier transform are the real exponential, and the lower limit of 0, which is obviously necessary for the integral to converge for f(x)=sin(x) say.

In the same way as in the Fourier case, you can take the Laplace transform of functions of x, to get functions of p. A common notation for the Laplace transform of f(x) is L(f).

An example: the Laplace transform of f(x)=exp(kx) is: 0 exp(x(k-p))dx=1/(k-p)

Their usefulness in solving differential equations stems from what happens when you take the laplace transform of the differential of a function.

L(df/dx)= 0 exp(-px)df/dxdx=pL(f)-f(x=0) (after integrating by parts)

This is great, because by taking the Laplace transform of both sides of an equation, we turn a DE into an algebraic equation. We solve for L, as a function of p. Note also, that the lower limit of zero means that the initial condition required is exactly the one we usually specify, i.e. the conditions at t=0 say. You can work out similar things for higher derivatives of f.

So now, once we have got L as a function of p, we can take the inverse Laplace transform, which is the solution of the DE. There is a problem here which that there is usually no unique inverse, but fortunately in most situations, the inverse is only arbitrary up to a null function. Since I am a physicist, I am allowed to ignore those.


How to get the inverse function?

1. look it up in a table (I like this one)
2. use a Bromwich integral
3. numerical techniques

1 is best. 2 is quite nasty - it is a contour integral along an infinite vertical line from g-i to g+i where g is a constant chosen so as to put all the singularities of L on the left hand side of the vertical line.
3. you must have had a silly DE to start off with

For normal linear 2nd order DEs, this is a very satisfying method, because you get the complimentary function and the particular integral at the same time rather than separately.
If you want more rigor, I think you can treat the transform as a linear operator on the Hilbert space of Lebesgue square integrable functions, but I know nothing about that.


By Sean Hartnoll (Sah40) on Thursday, August 3, 2000 - 02:04 am :

You can use Fourier transformations in differential equations also. Whether Laplace or Fourier transforms are more useful tends to depend on the equation in question and the boundary/initial conditions. Laplace transforms are more "natural" for exponential processes such as diffusion of heat into a cold material whilst Fourier is more useful in systems that are "wavey".

One advantage of the Laplace transform is that
more functions have a well-defined Laplace transform, because of the negative exponential in the integrand. A disadvantage is that you lose information for t< 0.

Inverting both Fourier and Laplace transformations is not too bad if you are nimble with contour integration. Particularly in the Laplace case it tends to reduce to being a sum of residues, as long as there are no branch points.

Sean


By Simon Judes (P2636) on Thursday, August 3, 2000 - 04:04 pm :

Yes, Fourier transforms can be used too. Which one is more useful depends on what sort of initial conditions you know. If, as in the case with the two armies, you want to specify the conditions at some initial time and see what happens after that, then Laplace transforms are most useful, because of the lower limit of 0.
In the Fourier case, I think you need to work out the limit of f(x)exp(-ipx) as x tends to ±infinity . This might be useful if say you want to calculate the electromagnetic field on an axis in the region of some disturbance, an oscillating dipole perhaps. Then you know that far away from the disturbance, you can take the field to be zero.

Simon