SEC Simulation

11.2. SEC Simulation#

import sys
sys.path.insert(0, r"D:\GitHub\molass-library")
from molass import get_version
assert get_version() >= '0.4.0', "This tutorial requires molass version 0.4.0 or higher."
from molass.SEC.ColumnSimulation import get_animation
anim = get_animation(num_frames=100, return_init=False)
display_html = False
to_mp4 = True
if display_html:
    # Display the animation in a Jupyter notebook
    from IPython.display import HTML
    HTML(anim.to_jshtml())
elif to_mp4:
    # Save the animation as an MP4 file
    anim.save("sec-saxs.mp4", writer="ffmpeg", fps=30)
else:
    # Save the animation as an HTML file
    anim.save("sec-saxs.gif")