def dist_ss_shear_bending(L, win, ain):
    """
    Shear Bending plot of distributed loads of a simply supported beam
    L = 10 # total length of beam
    win = [5]  # distributed load
    ain = [[3,4]]  # location of point load

    # or more multiple point moments
    L = 10
    win = [3,6]
    ain = [[0,3],[4,6]]
    """
    import numpy as np
    import matplotlib.pyplot as plt
    x = np.arange(0, L, L * 0.02)
    V = np.zeros(len(x))
    M = np.zeros(len(x))
    for a, w in zip(ain, win):
        P = w * (a[1] - a[0])
        l = (a[1] + a[0]) / 2
        i = [x < a[0]]
        V[i] += P * (1 - l / L)
        M[i] += x[i] * P * (1 - l / L)
        i = [x > a[1]]
        V[i] += -P * l / L
        M[i] += x[i] * -P * l / L + P * l
        i = [(a[0] <= x) & (x <= a[1])]
        V[i] += P * (1 - l / L) - w * (x[i] - a[0])
        M[i] += (P * (1 - l / L) - w * (x[i] - a[0])) * x[i] + w * (x[i] - a[0]
            ) * (a[0] + x[i]) / 2
    plt.figure()
    plt.title('Point Moment Loads')
    plt.subplot(2, 1, 1)
    plt.stem(x, V)
    plt.ylabel('V,shear')
    plt.subplot(2, 1, 2)
    plt.stem(x, M)
    plt.ylabel('M,moment')
