PHYS 501, Fall 2011: Solutions to Homework #5

  1. C solution to problem 1
    Compile the program with
        make hw5.1
    
    Run the program and pipe into gpl to see the results:
        hw5.1 N | gpl
    

  2. C solution to problem 2
    Compile the program with
        make hw5.2
    
    Run the program for instructions:
        hw5.2 --help
    
    Here are a script to automate the process, and some notes on the integrators used.

  3. C solution to problem 3
    Compile the program with
        make hw5.3
    
    Run the program and pipe into gpl or plot_data to see the results:
        hw5.3 40 50 | plot_data -p -l 0 1 -4 4
    
    To reduce the clutter, try
        hw5.3 40 50 | tail -n 20000 | plot_data -p -l 0 1 -4 4 -t 20000
    
    The solutions with the smallest |y'(0)| are
         y'(0) =  45.02
         y'(0) = -37.55     <-- min |y'(0)|