Physics 222 Assignment 3

Due February 6

Directions

Please turn in this assignment (and all future assignments for this course) by emailing them to me . Please use the subject of "Physics 222 HW3" for these assignments (if you use the link above, the subject will be added automatically). Please attach the source code to any programs that you write for this assignment. If you write more than one program, attach each separately. When answering the questions themselves feel free to answer directly in the body of your message (or attach your answers). I may take off points for assignments that are not sent to me in the correct form.

  1. Relativistic energy

    (based on problem 3.5 from Capper's Introducing C++) Write a program that plots the relativistic energy of particles based on their velocities. The relativistic energy has the form:

     E = m c2 / sqrt(1 - (v/c)2) .
    Your program should give the user the option of plotting the energy for the following particles: electron, proton, neutron, alpha, pion (π0), and muon.

    Your program should hold in a structure the following data for each particle: name, mass in kg, electric charge in fundamental charges, mean lifetime in second (use a value of -1 for stable particles), symbol (or abbreviation - no need to use greek letters), and whether the particle is a Boson or Fermion.

    When the user chooses a particle your program will print out the data it has stored about that particle, and then plot the energy versus speed for the following speed: 0.0, 0.4c, 0.7c, 0.9c, 0.99c, 0.99c, and 0.999c.

    Turn in the output and plots that your program returns when you pick protons and pions.

  2. Prime Numbers

    Write a program that finds and counts all the prime numbers between a given range of numbers. Include an example run of this program in your results finding the prime numbers between 2 and 1000.

    1. How many total prime numbers are there between 2 and 10000?
    2. How many prime numbers are there between 12000 and 12100?
  3. Review Questions from textbook

    4.10, 5.1, 5.3
  4. Project Proposal

    Write a one to two paragraph proposal of your project for this class, if you are doing a project. Include a detailed description of the problem that you are going to try to solve. Also mention any cases of this problem that you will use to check your results, especially any cases that can be solved analytically. Feel free to come talk to me if you need help finding a topic. In fact, you may want to talk to me about your topic, even if you know what you want to do.