from sympy import symbols
from sympy.physics.control.lti import TransferFunction
from spb import *
a, b, c, xi, wn, s, t = symbols("a, b, c, xi, omega_n, s, t")
tf1 = TransferFunction(25, s**2 + 10*s + 25, s)
tf2 = TransferFunction(wn**2, s**2 + 2*xi*wn*s + wn**2, s)
params = {
    xi: (6, 0, 10),
    wn: (25, 0, 50),
    a: (1, 0, 10, 50, "slope"),
    b: (0, 0, 5, 50, "lower limit"),
    c: (5, 2, 10, 50, "upper limit"),
}
graphics(
    line(a*t, (t, 0, c), params=params, label="ramp"),
    ramp_response(
        tf1, label="A", slope=a, lower_limit=b, upper_limit=c,
        params=params, control=False),
    ramp_response(
        tf2, label="B", slope=a, lower_limit=b, upper_limit=c,
        params=params, control=True),
    xlabel="Time [s]", ylabel="Amplitude")