diff --git a/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.ipynb b/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.ipynb index aba54b8c..803602ea 100644 --- a/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.ipynb +++ b/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.ipynb @@ -254,6 +254,7 @@ "\n", " return snapshot\n", "\n", + "\n", "system = System()\n", "snap = get_snap(system)\n", "snap = post_process_pos(snap)\n", @@ -319,7 +320,7 @@ ")\n", "periodic_params = dict(\n", " A = dict(A = 0.5, i = 0, w = 0.2, p = 2),\n", - " B = dict(A = 0.0, i = 0, w = 0.2, p = 1),\n", + " B = dict(A = 0.0, i = 0, w = 0.02, p = 1),\n", ")\n", "\n", "def generate_simulation(\n", @@ -403,7 +404,7 @@ }, "source": [ "The next parameters we need to define and run the method are the harmonic biasing spring constant,\n", - "(which we set to to $50$), the log frequency for the histogram ($50$), the number of steps we discard\n", + "(which we set to to $100$), the log frequency for the histogram ($50$), the number of steps we discard\n", "as equilibration before logging ($10^3$), and the number of time steps per replica ($10^4$).\n", "\n", "Since this runs multiple simulations, we expect the next cell to execute for a while." @@ -1028,7 +1029,7 @@ } ], "source": [ - "method = UmbrellaIntegration(cvs, 50.0, centers, 50, int(1e3))\n", + "method = UmbrellaIntegration(cvs, 100.0, centers, 50, int(1e3))\n", "raw_result = pysages.run(method, generate_simulation, int(1e4))\n", "result = pysages.analyze(raw_result)" ] @@ -1070,7 +1071,7 @@ "source": [ "import matplotlib.pyplot as plt\n", "\n", - "bins =50\n", + "bins = 50\n", "\n", "fig, ax = plt.subplots(2, 2)\n", "\n", @@ -1147,7 +1148,7 @@ "def external_field(r, A, p, w, **kwargs):\n", " return A * np.tanh(1 / (2 * np.pi * p * w) * np.cos(p * r))\n", "\n", - "x = np.linspace(-2, 2, 50)\n", + "x = np.linspace(-2, 2, 100)\n", "data = external_field(x, **periodic_params[\"A\"])\n", "\n", "centers = np.asarray(result[\"centers\"])\n", diff --git a/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.md b/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.md index 14c08246..e34ab57f 100644 --- a/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.md +++ b/examples/hoomd-blue/umbrella_integration/Umbrella_Integration.md @@ -122,6 +122,7 @@ def get_snap(system): return snapshot + system = System() snap = get_snap(system) snap = post_process_pos(snap) @@ -156,7 +157,7 @@ dpd_params = dict( ) periodic_params = dict( A = dict(A = 0.5, i = 0, w = 0.2, p = 2), - B = dict(A = 0.0, i = 0, w = 0.2, p = 1), + B = dict(A = 0.0, i = 0, w = 0.02, p = 1), ) def generate_simulation( @@ -211,14 +212,14 @@ centers = list(np.linspace(-1.5, 1.5, 25)) The next parameters we need to define and run the method are the harmonic biasing spring constant, -(which we set to to $50$), the log frequency for the histogram ($50$), the number of steps we discard +(which we set to to $100$), the log frequency for the histogram ($50$), the number of steps we discard as equilibration before logging ($10^3$), and the number of time steps per replica ($10^4$). Since this runs multiple simulations, we expect the next cell to execute for a while. ```python colab={"base_uri": "https://localhost:8080/"} id="wIrPB2N0bFIl" outputId="2f018685-a115-4c66-a21a-eef1d515bd02" -method = UmbrellaIntegration(cvs, 50.0, centers, 50, int(1e3)) +method = UmbrellaIntegration(cvs, 100.0, centers, 50, int(1e3)) raw_result = pysages.run(method, generate_simulation, int(1e4)) result = pysages.analyze(raw_result) ``` @@ -230,7 +231,7 @@ What is left after the run is evaluating the resulting histograms for each of th ```python colab={"base_uri": "https://localhost:8080/", "height": 265} id="OOpagwvlb3_d" outputId="62b507a1-d404-4924-ec1b-00b9d3f39085" import matplotlib.pyplot as plt -bins =50 +bins = 50 fig, ax = plt.subplots(2, 2) @@ -267,7 +268,7 @@ And finally, as the last step, we can visualize the estimated free-energy path f def external_field(r, A, p, w, **kwargs): return A * np.tanh(1 / (2 * np.pi * p * w) * np.cos(p * r)) -x = np.linspace(-2, 2, 50) +x = np.linspace(-2, 2, 100) data = external_field(x, **periodic_params["A"]) centers = np.asarray(result["centers"])