def solve_with_runge_kutta_method(k, m, x0, xk, n, h, t, w, x):
    for i in range(0, n):
        k1 = calculate_differential_equation(t, w[i], k, m)
        k2 = calculate_differential_equation(t + h / 2, w[i] + k1 * h / 2, k, m)
        k3 = calculate_differential_equation(t + h / 2, w[i] + k2 * h / 2, k, m)
        k4 = calculate_differential_equation(t + h, w[i] + h * k3, k, m)
        w.append(w[i] + h * (k1 + 2 * k2 + 2 * k3 + k4) / 6)
        t += h
        x.append(t)
def solve_with_runge_kutta_method(k, m, x0, xk, n, h, t, w, x):
    for i in range(0, n):
        k1 = calculate_differential_equation(t, w[i], k, m)
        k2 = calculate_differential_equation(t + h / 2, w[i] + k1 * h / 2, k,
                                             m)
        k3 = calculate_differential_equation(t + h / 2, w[i] + k2 * h / 2, k,
                                             m)
        k4 = calculate_differential_equation(t + h, w[i] + h * k3, k, m)
        w.append(w[i] + h * (k1 + 2 * k2 + 2 * k3 + k4) / 6)
        t += h
        x.append(t)
def solve_with_euler_method(k, m, x0, xk, n, h, t, w, x):
    for i in range(0, n):
        w.append(w[i] + h * calculate_differential_equation(t, w[i], k, m))
        t += h
        x.append(t)
def solve_with_euler_method(k, m, x0, xk, n, h, t, w, x):
    for i in range(0, n):
        w.append(w[i] + h * calculate_differential_equation(t, w[i], k, m))
        t += h
        x.append(t)