You will write three functions that find forces between charges on a line. They use Coulomb's law and the principle of superposition.
The idea. The force between two charges is . Like charges repel. Unlike charges attract. We give a force a plus sign when it pushes towards and a minus sign when it pushes towards .
Your tasks.
force_from, return the force on a charge q at x that is caused by one other charge q_other at x_other. All positions are in m on a line.net_force, others is a list of pairs (charge, position). Return the net force on q at x, which is the sum of the forces from all the others.zero_point, two positive charges q1 at x = 0 and q2 at x = d are fixed. Return the distance from q1 of the point between them where the net force on a small positive charge is zero.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…