|
327 | 327 | "metadata": {}, |
328 | 328 | "outputs": [], |
329 | 329 | "source": [ |
| 330 | + "# with OpenMM 8.0 or earlier: timestep = engine.snapshot_timestep\n", |
| 331 | + "# (also should work for data generated with OpenMM 8.1 or later)\n", |
| 332 | + "timestep = 2.0 * openmm.unit.femtosecond\n", |
330 | 333 | "path_lengths = [len(step.active[0].trajectory) for step in flexible.steps]\n", |
331 | 334 | "plt.hist(path_lengths, bins=40, alpha=0.5);\n", |
332 | | - "print(\"Maximum:\", max(path_lengths), \"(\"+str(max(path_lengths)*engine.snapshot_timestep)+\")\")\n", |
333 | | - "print(\"Average:\", \"{0:.2f}\".format(np.mean(path_lengths)), \"(\"+(np.mean(path_lengths)*engine.snapshot_timestep).format(\"%.3f\")+\")\")\n", |
| 335 | + "print(\"Maximum:\", max(path_lengths), \"(\"+str(max(path_lengths)*timestep)+\")\")\n", |
| 336 | + "print(\"Average:\", \"{0:.2f}\".format(np.mean(path_lengths)), \"(\"+(np.mean(path_lengths)*timestep).format(\"%.3f\")+\")\")\n", |
334 | 337 | "plt.ylabel(\"Count\")\n", |
335 | 338 | "plt.xlabel(\"Path length (Frames)\");" |
336 | 339 | ] |
|
468 | 471 | ], |
469 | 472 | "metadata": { |
470 | 473 | "kernelspec": { |
471 | | - "display_name": "Python 3", |
| 474 | + "display_name": "Python 3 (ipykernel)", |
472 | 475 | "language": "python", |
473 | 476 | "name": "python3" |
474 | 477 | }, |
|
482 | 485 | "name": "python", |
483 | 486 | "nbconvert_exporter": "python", |
484 | 487 | "pygments_lexer": "ipython3", |
485 | | - "version": "3.7.10" |
| 488 | + "version": "3.9.13" |
486 | 489 | }, |
487 | 490 | "toc": { |
488 | 491 | "base_numbering": 1, |
|
0 commit comments