hoomd.variant¶
Overview
hoomd.variant.linear_interp |
Linearly interpolated variant. |
Details
Specify values that vary over time.
This package contains various commands for creating quantities that can vary smoothly over the course of a simulation. For example, set the temperature in a NVT simulation to slowly heat or cool the system over a long simulation.
-
class
hoomd.variant.
linear_interp
(points, zero='now')¶ Linearly interpolated variant.
Parameters: hoomd.variant.linear_interp
creates a time-varying quantity where the value at each time step is determined by linear interpolation between a given set of points.At time steps before the initial point, the value is identical to the value at the first given point. At time steps after the final point, the value is identical to the value at the last given point. All points between are determined by linear interpolation.
Time steps given to
hoomd.variant.linear_interp
are relative to the current step of the simulation, and starts counting from 0 at the time of creation. Set zero to control the relative starting point.points is a list of
(time step, set value)
tuples. For example, to specify a series of points that goes from 10 at time step 0 to 20 at time step 100 and then back down to 5 at time step 200:points = [(0, 10), (100, 20), (200, 5)]
Any number of points can be specified in any order. However, listing them monotonically increasing in time will result in a much more human readable set of values.
Examples:
L = variant.linear_interp(points = [(0, 10), (100, 20), (200, 5)]) V = variant.linear_interp(points = [(0, 10), (1e6, 20)], zero=80000) integrate.nvt(group=all, tau = 0.5, T = variant.linear_interp(points = [(0, 1.0), (1e5, 2.0)])