<jupyter_start><jupyter_text>Testing re-orientation in perfectly rotating flow.The result should be a sine shape in components A_11 and A_22<jupyter_code>import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from fiberoripy.orientation import ard_rsc_ode
# geometric factor
xi = 1.0

# time steps
t = np.linspace(0, np.pi, 500)

# initial fiber orientation state
A0 = np.zeros((3, 3))
A0[0, 0] = 0.5
A0[2, 2] = 0.5
# define a function that describes the (time-dependend) velocity gradient
def L(t):
    """Velocity gradient."""
    return np.array([[0.0, 1.0, 0.0], [-1.0, 0.0, 0.0], [0.0, 0.0, 0.0]])
# compute solution by integrating the ODE
A = odeint(
    ard_rsc_ode,
    A0.ravel(),
    t,
    args=(xi, L, 1.924e-4, 1.0 / 30.0, 5.839e-3, 0.04, 1.168e-5, 0.0),
)
# plot components
plt.plot(t, A[:, 0], "-", label="A11")
plt.plot(t, A[:, 4], "--", label="A22")
plt.plot(t, A[:, 8], "-.", label="A33")
plt.plot(t, A[:, 2], ":", label="A31")

# adjust some plot settings.
plt.xlabel("Time $t$ in s")
plt.ylim([0, 1])
plt.grid()
plt.legend()
plt.tight_layout()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18766519823788547, 'fraction_numerical': 0.07136563876651983, 'mean_word_length': 3.982456140350877, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '207963', 'license': 'MIT', 'n_tokens_mistral': 525, 'n_tokens_neox': 472, 'n_words': 130, 'path': 'examples/orientation/ardrsc_perfectrotation.ipynb', 'repo_name': 'JulianKarlBauer/fiberoripy', 'size': '1135'}