$max_val = 0;d $max_m = 0; $max_n = 0; for ($m = 1; $m < 1982; $m++) { for ($n = 1; $n < 1982; $n++) { $val = $n*$n - $m*$n - $n*$n; $val = $val*$val; if($val == 1) { $val = $m*$m + $n*$n; if($val > $max_val) { $max_val = $val; $max_m = $m; $max_n = $n; } } } } print "Max Value: ".$max_val." m: ". $max_m." n: ".$max_n;
Archive for December, 2007
Perl
December 6th, 2007Test
December 1st, 2007Question: Write down the equation of motion for a charged particle in uniform, parallel electric and magnetic fields, both in the z-direction, and solve it, given that the particle starts from the origin with the velocity
. A screen is placed at x=a where
. Show that the locus of points of arrival of particles with given m and q, but different speeds
, is approximately a parabola.
Answer: The equation of motion is given by the Lorentz Force equation:

However, since
and
for this problem, the equation of motion becomes

which reduces to

First, lets solve
. If we integrate
, we get

, this means
. Therefore,
.
If we integrate again, we get:

, this means
. Therefore,
.
Next, we will reduce the other two equations


, therefore
.We can similar reduce 

, therefore
.If we put these equations into the original equations of motion, we can decouple the x and y terms.

which has a general solution of

However, since
, therefore
.
In order to calculate A, we need to take the derivative.

, the following reduction can be made
. Therefore,
and
.
Also, since
, we can solve for y


This means the equation of motion is:




