Ever since scientists realized that the sun is powered by nuclear fusion reactions, people have been thinking about causing these reactions to occur in the laboratory in order to create a clean and abundant energy source. For at least five decades, this dream has been frustrated by a repulsive problem. The problem is that fusion involves bringing two positively charged nuclei very close to each other. The force between two charges is given by this equation: $$F_e = \frac{k q_1 q_2}{r^2}$$

Equivalently, the electric field from a point charge is given by: $$ E = \frac{k q_1}{r^2}$$ where the force on a nearby charge is $F = qE$.

As the distance, $r$, between the two charges becomes small, the electric field becomes *dramatically* larger. This creates a huge repulsive force, which is the main reason why fusion energy sources haven't been developed yet.

**In this exercise, there will be two charges but one of these charges will be fixed in place so it can't move. This charge is called the "target" because we are throwing the other particle towards it a little bit like an arrow trying to hit the bullseye.**

**1. Open up the repulsion code in an editor**

Click on this link to open the repulsion code in an editor

When you click play you will notice that the two particles pass right through each other without interacting.

**Important! Create an account with the editor or sign in to an existing account. Then click "Duplicate"
so you can have your own version of the code!**

**2. Fill in the blanks! Put in a formula for the electric field of a point charge**

Look closely at these lines of code:

r = abs(x - x_target); if (x < x_target) { E = 0; // fix this!! } else if (x > x_target) { E = 0; // fix this!! } deltaVx = (q*E/mass)*dt;

The last line `deltaVx = (q*E/mass)*dt`

should be familiar to you from the accelerator exercise.

Use the formula for the electric field from a point charge to fix the if statement. (And we definitely need an if statement here because the electric field of a positive particle always points away from it. Thus for x < x_target the electric field should point to the left, but for x > x_target the electric field should point to the right. Is +x to the right or the left?)

If you make these changes correctly, the code should behave like this

**3. Calculate the expected distance of closest approach**

We can use energy conservation and potential energy to figure out how close two particles will get to each other: $$KE_i + PE_i = KE_f + PE_f = {\rm constant}$$

Imagine that there is some particle with some initial velocity, $v_i$, heading directly towards another particle. For simplicity, let's make the second particle stationary. The kinetic energy of this incoming particle is just this: $$KE_i = \frac{1}{2} m v_i^2$$

We will ignore the kinetic energy of the other particle because it is held fixed.

The potential energy of two point charges is given by: $$PE = \frac{k q_1 q_2}{r}$$

This means that the initial potential energy is $PE_i = k q_1 q_2 / r_i$ and the final potential energy is $PE_f = k q_1 q_2 / r_f$ where $r_i$ is the initial distance between the two charges and $r_f$ is the final distance between the two charges.

We want to know what is the distance of the closest approach that the two particles make. This is the distance where the incoming particle turns around and starts moving away from the other particle. So when the particle is closest, its velocity will be zero, and as a result $KE_f = 0$. The energy conservation equation simplifies to this: $$KE_i + PE_i = PE_f$$ $$\frac{1}{2} m v_i^2 + \frac{k q_1 q_2}{r_i} = \frac{k q_1 q_2}{r_f}$$

**Solve for $r_f$ in terms of $m$, $v_i$, $k$, $q_1$, $q_2$ and $r_i$. Leave your answer symbolic for now!**

**4. Does your measurement of $r_f$ match the expectation? (Hint: it should!)**

Write down your expected $r_f$ and the measured $r_f$ in what you submit for this lab. These numbers should be within 10% of each other or else something has gone wrong.

Note that in this example `k = 100000;`

instead of the usual value of $9 \cdot 10^9$, which would push the particles apart faster than it would be enjoyable to watch.

**5. How fast does the incoming particle need to be traveling in order to come so close to the other particle that the edges of the particles begin to overlap?** Change the line `vx = 50.0;`

to something else.

**6. Does it help if the charge of the incoming particle is larger or smaller? why?**

**7. Does it help if the mass of the incoming particle is larger or smaller? why?**

**8. Does it help if the charge of the stationary particle is larger or smaller? why?**

**Challenge #1:** Add something fun to the program that only happens when the two particles are very close to each other. For example, write "Fusion!" to the screen.

**Challenge #2:** Change the initial velocity of the incoming particle to zero (vx = 0; vy = 0;) and change the initial x value so that it starts very close to the target particle (instead of x = 0). Run the program and watch the "incoming" particle repel and get accelerated to high speed. Use the equations that you used earlier in this exercise to calculate the max speed the particle should get to once it is far away and the potential energy ($\rm PE_f$) is essentially zero.

**Aside:** This is a lot like nuclear fission. When a nucleus splits in two, the result is two positively charged nuclei that are initially very close together, repel away from each other, reaching high speed. If enough of these reactions happen, these fast moving particles can heat up water to make steam, which can be used to turn turbines. This is an over-simplified explanation but you get the idea.

**Challenge #3:** Use what you've learned in this coding activity to explain why neutrons (which have a charge of zero) are the perfect particle to use if your goal is to get a particle to collide with a positively charged nucleus. Which parts of this coding activity bring you to this conclusion?

**Challenge #4:** Let both particles move in response to each other. Try to calculate and measure the closest distance that they reach.