Skip to content

Steppers

ProportionalTimeStepper

A simple time stepper with proportional time increments.

This class represents a simple time stepper with proportional time increments. It increments the time by a fixed time step in each step.

Attributes: t (float): The current time.

Source code in src/fragma/steppers.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
class ProportionalTimeStepper:
    """A simple time stepper with proportional time increments.

    This class represents a simple time stepper with proportional time increments.
    It increments the time by a fixed time step in each step.

    Attributes:
        t (float): The current time.
    """

    def __init__(self):
        """Initialize the time stepper."""
        # Initialize the time
        self.t = 0

    def increment(self):
        """Increment the time by the time step."""
        # Increment time
        self.t += 1

__init__()

Initialize the time stepper.

Source code in src/fragma/steppers.py
11
12
13
14
def __init__(self):
    """Initialize the time stepper."""
    # Initialize the time
    self.t = 0

increment()

Increment the time by the time step.

Source code in src/fragma/steppers.py
16
17
18
19
def increment(self):
    """Increment the time by the time step."""
    # Increment time
    self.t += 1