<jupyter_start><jupyter_text>TAU Future Scientists - CERN TourThis notebook is written in Python in the Jupyter framework, which allows visualization and interactivity with the notebook via a web platform (e.g. a Jupyter server that can be connected to via a web browser). Feel free to change anything in the code below to see how things change in response. Notebooks are places for people to play with software and ideas.<jupyter_code># Basic library includes - we will need these libraries later in the notebook

# Visualization libraries
import matplotlib.pyplot as plt

# interact with notebooks
from ipywidgets import widgets
from ipywidgets import interact

# mathematics and numbers
import math
import numpy as np<jupyter_output><empty_output><jupyter_text>Examples Accompanying the "Coulomb's Law and Modern Physics" Discussion<jupyter_code>%matplotlib notebook
# Inputs for Coulomb's Law Computation

epsilon0 = 8.85e12 # C^2/(Nm^2)
global e
e = 1.602e-19 # Coulombs


# define Coulomb's Force Law as a Function - takes charges and plots force vs. distance

def CoulombsLaw_Force(q1=1,q2=1,F_max_multiplier=1,r_max_multiplier=1):
    global e
    r_max = 1e-18
    r_step = r_max/100000
    r = np.arange(1e-30, r_max, r_step)
    F = (1./(4*np.pi*epsilon0))*((q1*q2)/r**2)
    figure, axis = plt.subplots()
    l0, = axis.plot(r, F, visible=True, lw=2, color='b', label="Coulomb's Force Law")
    plt.grid()

    F_max = F_max_multiplier*1e26
    axis.set_ylim([-100*F_max, 100*F_max])
    axis.set_xlim([0, r_max_multiplier*1e-21])
    axis.set_xlabel("Charge Separation Distance [m]")
    axis.set_ylabel("Force [N]")
    
interact(CoulombsLaw_Force,
         q1=widgets.FloatSlider(min=-10,max=10,step=1,value=1,  description="Charge 1", orientation="horizontal"),
         q2=widgets.FloatSlider(min=-10,max=10,step=1,value=-1, description="Charge 2", orientation="horizontal"),
         F_max_multiplier=widgets.FloatSlider(min=1,max=100,step=1,value=10, description="Max. Force Magnitude", orientation="horizontal"),
         r_max_multiplier=widgets.FloatSlider(min=1,max=100,step=1,value=10, description="Max. Distance", orientation="horizontal"))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.110250569476082, 'fraction_numerical': 0.03781321184510251, 'mean_word_length': 5.134078212290503, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '312096', 'license': 'Apache-2.0', 'n_tokens_mistral': 795, 'n_tokens_neox': 741, 'n_words': 197, 'path': 'TAU-2018.ipynb', 'repo_name': 'stephensekula/TAU-Higgs-School', 'size': '2195'}