Extrema of closure approximations¶
In [1]:
try:
%matplotlib widget
except (ImportError, RuntimeError):
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from fiberoripy.closures import get_random_tensor_pair
from fiberoripy.tensorplot import plot_orbit2, plot_orbit4
In [2]:
# define second order fiber orientation tensor
a_iso = 1.0 / 3.0 * np.eye(3)
a_uni = np.array([[0.9, 0, 0], [0, 0.05, 0], [0, 0, 0.05]])
a_pln = np.array([[0.4, 0, 0], [0, 0.4, 0], [0, 0, 0.1]])
# create a fourth order fiber orientation tensor
_, A_iso = get_random_tensor_pair(seed=a_iso, N=5000)
_, A_uni = get_random_tensor_pair(seed=a_uni, N=5000)
_, A_pln = get_random_tensor_pair(seed=a_pln, N=5000)
In [3]:
# Second order tensor plot (isotropic)
fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(111, projection=Axes3D.name)
ax._axis3don = False
plotargs = {"color": [0, 0.588, 0.510], "rstride": 1, "cstride": 1}
plot_orbit2(ax, plotargs, a_iso)
plt.show()
In [4]:
# Second order tensor plot (unidirectional)
fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(111, projection=Axes3D.name)
ax._axis3don = False
plotargs = {"color": [0, 0.588, 0.510], "rstride": 1, "cstride": 1}
plot_orbit2(ax, plotargs, a_uni)
plt.show()
In [5]:
# Second order tensor plot (planar)
fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(111, projection=Axes3D.name)
ax._axis3don = False
plotargs = {"color": [0, 0.588, 0.510], "rstride": 4, "cstride": 4}
plot_orbit2(ax, plotargs, a_pln)
plt.show()
In [6]:
# Fourth order tensor plot
fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(111, projection=Axes3D.name)
plotargs = {"color": [0, 0.588, 0.510], "rstride": 1, "cstride": 1}
plot_orbit4(ax, plotargs, A_iso)
plt.show()