Stepping time¶
These are helper methods for the time step. They are mainly used for the euler step, because the higher order schemes are self stabilising.
-
time_step.remesh(dt, k=3)¶ Method for remeshing.
In this method the save distance for points to be at is evaluated and then the curve remeshed. It is done by interpolating between all vertices with splines and use this parameter curve to place vertices at equal distance. The only two points left out are the first end last point. The amount of points is adjusted according to the spacing and the time step size.
Parameters: data: numpy array
Numpy array of the vertices of shape (N,2)
dt: double
Time step size to compare to
k: int, optional
Dimension for the splines. Default is 3 (cubic). Optionally would be 1 (linear). Only use odd values.
Returns: numpy array
Numpy array of updated vertices of shape (N,2)
double
Space step size used in this step
-
time_step.remove(dx)¶ Remove vertices, that are to close together.
Parameters: data: numpy array
Numpy array of the vertices of shape (n,2).
dx: double
Minimal space step size for the vertices.
Returns: Numpy array
Vertices with one of the ones which are to close removed.
-
time_step.rescale_length(set_length)¶ Rescales the length of the curve.
In order to see the change in form of the curve better, the length is rescaled to a specific length. This is done by moving every vertex outwards by the amount the length has to be changed. This only works if the length is smaller then the final length.
Parameters: data: numpy array
Array of the vertices which are rescaled. Shape is (n,2).
set_length: double
Length to which the curve is rescaled.
Returns: numpy array
Vertices with the rescaled length.
The simplest possible time step method is
-
time_step.euler_forward()¶ Simple forward Euler time step with adapted time step size.
The stepsize is chosen such that the largest curvature is still stable.