Studies: sweep any quantity, compare bearings

Two circular pads of different size are compared over a tilt sweep, and one of them over film thickness at three supply pressures. The same request dicts can be saved as JSON and run again later, or sent from a user interface.

ex10 study tilt and compare
import matplotlib.pyplot as plt
import numpy as np

from openairbearing import study
from openairbearing.plots import COLOURS, plot_output

# the series of every plot in blue, red, black and grey, in that order
plt.rcParams["axes.prop_cycle"] = plt.cycler(color=COLOURS)


def main():
    pads = [
        {"name": "Ø37 mm", "case": {"kind": "circular_pad", "radius": 18.5e-3}},
        {"name": "Ø50 mm", "case": {"kind": "circular_pad", "radius": 25e-3}},
    ]

    tilt = study.run(
        {
            "cases": pads,
            "sweep": [
                {"path": "position.rx", "values": np.linspace(0, 2e-4, 9).tolist()}
            ],
        }
    )
    gap = study.run(
        {
            "cases": pads[:1],
            "sweep": [
                {"path": "ps", "values": [0.3e6, 0.5e6, 0.7e6]},
                {"path": "position.h", "values": np.linspace(2e-6, 15e-6, 14).tolist()},
            ],
            "stiffness": True,
        }
    )

    fig, axes = plt.subplots(2, 2, figsize=(10, 8))
    plot_output(tilt, "force.h", axes[0, 0])
    plot_output(tilt, "force.rx", axes[0, 1])
    plot_output(gap, "force.h", axes[1, 0], x_axis=1)
    plot_output(gap, "stiffness.h.h", axes[1, 1], x_axis=1)
    fig.tight_layout()
    plt.show()
    return tilt, gap


if __name__ == "__main__":
    main()

Total running time of the script: (0 minutes 26.708 seconds)