Generating Data and Visualizing Results -------------------------------------- This guide explains how to compile the code, generate data for specific figures, and process it using Python scripts. Follow these steps to reproduce the figures in the paper. Running the C++ Code -------------------- ### Compilation Navigate to the C++ folder and execute the script: ./compile.sh Adjust the value of `j` in `compile.sh` to run the code on multiple screens with different ranks (`screennum` in the code). Alternatively, compile manually using: g++ TPS_rtp.cpp nrutil.cpp random_mars.cpp -o TPS_rtp -O2 -w Generating Data for Figures ---------------------------- ### Figures 3, 4, and 7 (Length Distributions) and Figure 1 (Trajectory) Use the `sampling` function with the appropriate parameters: sampling(Pe, tr, rr, sample_size, TPS, BF, SS); Where: - **Pe**: Peclet number (set globally on line 66; update `vdrive` after changes) - **tr**: Tumble rate (set in line 167) - **rr**: Run rate (set in line 167) - **sample_size**: Number of trajectories - **TPS, BF, SS**: Boolean flags to sample TPS, brute-force, or steady-state distributions ### Example for Figure 1 and Figure 3 For **TPS**: sampling(10, 2, 100000000, true, false, true); For **MD**: sampling(0, 2, 1000000, false, true, false); sampling(10, 2, 1000000, false, true, false); sampling(2, 0, 1000000, false, true, false); sampling(2, 2, 1000000, false, true, false); ### For Figure 4 Run the following loop: for (int tr = 0; tr <= 40; tr += 2) { for (int rr = 2; rr <= 40; rr += 2) { sampling(10, tr, rr, 100000000, true, false, true); } } ### For Figure 5 Use the parameters: - `tr = 1, rr = 1` - `tr = 1, rr = 10` - `tr = 10, rr = 10` Call: sampling(10, tr, rr, 100000000, true, false, true); If `tr = rr = 1`: - Modify line 140 to set the seed to `screennum`. - In the paper, a total of 1900 different seeds were used. You can parallelize this using the `j` value in `compile.sh` and screen. ### For Figure 6 Set Pe, tr, rr to (10, 1, 1). For different values of `dt`, set `dt = 0.1`, `dt = 0.001`, or `dt = 0.00001`. Call the functions: brute_force_lengthdist_rtpe(100000); brute_force_lengthdist(100000); ### For Figure 7 #### For the TPS files, use: sampling(10, 2, 0, 100000000, true, false, true); sampling(10, 0, 2, 100000000, true, false, true); sampling(10, 6, 2, 100000000, true, false, true); sampling(10, 10, 10, 100000000, true, false, true); sampling(10, 1, 10, 100000000, true, false, true); sampling(10, 1, 1, 100000000, true, false, true); #### For the MD files, use: sampling(10, 2, 0, 1000000, false, true, false); sampling(10, 0, 2, 1000000, false, true, false); sampling(10, 6, 2, 1000000, false, true, false); sampling(10, 10, 10, 1000000, false, true, false); sampling(10, 1, 10, 1000000, false, true, false); sampling(10, 1, 1, 1000000, false, true, false); Python Scripts -------------- After generating the necessary data, use the provided Python scripts to process and visualize the results. Adjust file paths and names in the scripts as needed.