Repository: ross-rotordynamics/ross
Pull request #87 (2019-04-11 17:49:51)

Change appveyor badge to track master
This changes the appveyor badge that appears in the repository main page
to track only builds that are related to the master branch.
We should have the badge only for the master branch since PRs with
failing builds will not be merged anyway.
The previous badge was tracking all builds, including those from new
pull requests that were failing before merging to master.


Patch:
diff --git a/README.md b/README.md
index 5b1a518d..86097ffc 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # Rotodynamic Open Source Software (ROSS)
 
 [![Build Status](https://travis-ci.com/ross-rotordynamics/ross.svg?branch=master)](https://travis-ci.com/ross-rotordynamics/ross)
-[![Build status](https://ci.appveyor.com/api/projects/status/tvsj4jh7bowvn0ht?svg=true)](https://ci.appveyor.com/project/raphaeltimbo/ross)
+[![Build status](https://ci.appveyor.com/api/projects/status/tvsj4jh7bowvn0ht/branch/master?svg=true)](https://ci.appveyor.com/project/raphaeltimbo/ross/branch/master)
 <a href="https://codecov.io/gh/ross-rotordynamics/ross">
 <img src="https://codecov.io/gh/ross-rotordynamics/ross/branch/master/graph/badge.svg">
 </a>
diff --git a/ross/__init__.py b/ross/__init__.py
index 047a567e..5ce0d81a 100644
--- a/ross/__init__.py
+++ b/ross/__init__.py
@@ -1,5 +1,15 @@
+from . import materials as mtr
+from . import element
+from . import bearing_seal_element as bse
+from . import disk_element as disk
+from . import results as rst
+from . import rotor_assembly as rotor
+from . import shaft_element as shaft
 from .materials import *
-from .bearing_seal_element import *
+from .rotor_assembly import *
 from .disk_element import *
 from .shaft_element import *
-from .rotor_assembly import *
+from .shaft_element import *
+from .results import *
+from .bearing_seal_element import *
+from .element import *
diff --git a/ross/fluid_flow/fluid_flow.py b/ross/fluid_flow/fluid_flow.py
index accad4f6..9cb26a81 100644
--- a/ross/fluid_flow/fluid_flow.py
+++ b/ross/fluid_flow/fluid_flow.py
@@ -40,8 +40,13 @@ class PressureMatrix:
         Rotor radius (m).
     radius_stator: float
         Stator Radius (m).
-    eccentricity: float
-        Eccentricity (m) is the euclidean distance between rotor and stator centers.
+    xi: float
+        Eccentricity (m) (distance between rotor and stator centers) on the x-axis.
+        It is the position of the center of the rotor.
+        The center of the stator is in position (0,0).
+    yi: float
+        Eccentricity (m) (distance between rotor and stator centers) on the y-axis.
+        It is the position of the center of the rotor.
         The center of the stator is in position (0,0).
 
     Fluid characteristics
@@ -74,14 +79,6 @@ class PressureMatrix:
         Number of intervals on r.
     p_mat : array of shape (nz, ntheta)
         The pressure matrix.
-    xi: float
-        Eccentricity (m) (distance between rotor and stator centers) on the x-axis.
-        It is the position of the center of the rotor.
-        The center of the stator is in position (0,0).
-    yi: float
-        Eccentricity (m) (distance between rotor and stator centers) on the y-axis.
-        It is the position of the center of the rotor.
-        The center of the stator is in position (0,0).
     re : array of shape (nz, ntheta)
         The external radius in each position of the grid.
     ri : array of shape (nz, ntheta)
@@ -96,12 +93,12 @@ class PressureMatrix:
         y value of the external radius.
     yri : array of shape (nz, ntheta)
         y value of the internal radius.
-    eccentricity : float
+    distance_between_centers : float
         distance between the center of the rotor and the stator.
     difference_between_radius: float
         distance between the radius of the stator and the radius of the rotor.
     eccentricity_ratio: float
-        eccentricity/difference_between_radius
+        distance_between_centers/difference_between_radius
     bearing_type: str
         type of structure. 'short_bearing': short; 'long_bearing': long;
         'medium_size': in between short and long.
@@ -141,8 +138,8 @@ class PressureMatrix:
 
     """
     def __init__(self, nz, ntheta, nradius, length, omega, p_in,
-                 p_out, radius_rotor, radius_stator, eccentricity,
-                 visc, rho, plot_eccentricity=False):
+                 p_out, radius_rotor, radius_stator, xi,
+                 yi, visc, rho, plot_eccentricity=False):
         self.nz = nz
         self.ntheta = ntheta
         self.nradius = nradius
@@ -159,9 +156,8 @@ class PressureMatrix:
         self.p_out = p_out
         self.radius_rotor = radius_rotor
         self.radius_stator = radius_stator
-        self.eccentricity = eccentricity
-        self.xi = np.sqrt(2)*eccentricity/2
-        self.yi = -self.xi
+        self.xi = xi
+        self.yi = yi
         self.visc = visc
         self.rho = rho
         self.re = np.zeros([self.nz, self.ntheta])
@@ -176,8 +172,9 @@ class PressureMatrix:
         self.plot_counter = 0
         self.calculate_coefficients(plot_eccentricity)
         self.pressure_matrix_available = False
+        self.distance_between_centers = np.sqrt((xi**2 + yi**2))
         self.difference_between_radius = radius_stator - radius_rotor
-        self.eccentricity_ratio = self.eccentricity/self.difference_between_radius
+        self.eccentricity_ratio = self.distance_between_centers/self.difference_between_radius
 
     def calculate_pressure_matrix(self):
         """This function calculates the pressure matrix
@@ -240,10 +237,23 @@ class PressureMatrix:
         yri: float
             The position y of the returned internal radius.
         """
-        radius_internal = self.radius_rotor
-        xri = radius_internal * np.cos(gama - np.pi/4)
-        yri = radius_internal * np.sin(gama - np.pi/4)
-        return radius_internal, xri + self.xi, yri + self.yi
+        e = np.sqrt(self.xi ** 2 + self.yi ** 2)
+        if self.xi > 0:
+            beta = np.arctan(self.yi / self.xi)
+        elif self.xi < 0:
+            beta = -np.pi + np.arctan(self.yi / self.xi)
+        else:
+            if self.yi > 0.:
+                beta = np.pi / 2.
+            else:
+                beta = -np.pi / 2.
+        alpha = gama - beta
+        radius_internal = e * np.cos(alpha) + np.sqrt(
+            self.radius_rotor ** 2 - (e * np.sin(alpha)) ** 2
+            )
+        xri = radius_internal * np.cos(gama)
+        yri = radius_internal * np.sin(gama)
+        return radius_internal, xri, yri
 
     def external_radius_function(self, gama):
         """This function calculates the radius of the stator.
@@ -261,8 +271,8 @@ class PressureMatrix:
             The position y of the returned external radius.
         """
         radius_external = self.radius_stator
-        xre = radius_external * np.cos(gama - np.pi/4)
-        yre = radius_external * np.sin(gama - np.pi/4)
+        xre = radius_external * np.cos(gama)
+        yre = radius_external * np.sin(gama)
 
         return radius_external, xre, yre
 
@@ -361,7 +371,7 @@ class PressureMatrix:
         r = np.arange(0, self.radius_stator + 0.0001, (
             self.radius_stator - self.radius_rotor)/self.nradius
             )
-        theta = np.arange(-np.pi*0.25, 1.75*np.pi + self.dtheta/2, self.dtheta)
+        theta = np.arange(0, 2*np.pi + self.dtheta/2, self.dtheta)
 
         pressure_along_theta = np.zeros(self.ntheta)
         for i in range(0, self.ntheta):
diff --git a/ross/materials.py b/ross/materials.py
index 9295eee6..9af43469 100644
--- a/ross/materials.py
+++ b/ross/materials.py
@@ -6,9 +6,6 @@ some of the most common materials used in rotors.
 import toml
 
 
-__all__ = ["Material", "steel"]
-
-
 class Material:
     """Material.
 
diff --git a/ross/rotor_assembly.py b/ross/rotor_assembly.py
index 9397ff39..7f2631cf 100644
--- a/ross/rotor_assembly.py
+++ b/ross/rotor_assembly.py
@@ -96,27 +96,25 @@ class Rotor(object):
     Examples
     --------
     >>> #  Rotor without damping with 2 shaft elements 1 disk and 2 bearings
-    >>> import ross as rs
-    >>> steel = rs.materials.steel
+    >>> from ross.materials import steel
     >>> z = 0
     >>> le = 0.25
     >>> i_d = 0
     >>> o_d = 0.05
-    >>> tim0 = rs.ShaftElement(le, i_d, o_d, steel,
-    ...                        shear_effects=True,
-    ...                        rotary_inertia=True,
-    ...                        gyroscopic=True)
-    >>> tim1 = rs.ShaftElement(le, i_d, o_d, steel,
-    ...                        shear_effects=True,
-    ...                        rotary_inertia=True,
-    ...                        gyroscopic=True)
+    >>> tim0 = ShaftElement(le, i_d, o_d, steel,
+    ...                    shear_effects=True,
+    ...                    rotary_inertia=True,
+    ...                    gyroscopic=True)
+    >>> tim1 = ShaftElement(le, i_d, o_d, steel,
+    ...                    shear_effects=True,
+    ...                    rotary_inertia=True,
+    ...                    gyroscopic=True)
     >>> shaft_elm = [tim0, tim1]
-    >>> disk0 = rs.DiskElement.from_geometry(1, steel, 0.07, 0.05, 0.28)
+    >>> disk0 = DiskElement(1, steel, 0.07, 0.05, 0.28)
     >>> stf = 1e6
-    >>> bearing0 = rs.BearingElement(0, kxx=stf, cxx=0)
-    >>> bearing1 = rs.BearingElement(2, kxx=stf, cxx=0)
-    >>> rotor = rs.Rotor(shaft_elm, [disk0], [bearing0, bearing1])
-    >>> rotor.run()
+    >>> bearing0 = BearingElement(0, kxx=stf, cxx=0)
+    >>> bearing1 = BearingElement(2, kxx=stf, cxx=0)
+    >>> rotor = Rotor(shaft_elm, [disk0], [bearing0, bearing1])
     >>> rotor.wd[0] # doctest: +ELLIPSIS
     215.3707...
     """
@@ -281,10 +279,8 @@ class Rotor(object):
 
         #  diameter at node position
 
-        print(
-            "To check the rotor geometry, use the method plot_rotor()\n"
-            "To calculate the rotor state, use the method run()"
-        )
+        print("To check the rotor geometry, use the method plot_rotor()\n"
+              "To calculate the rotor state, use the method run()")
 
     def __eq__(self, other):
         if self.elements == other.elements and self.parameters == other.parameters:
@@ -553,12 +549,7 @@ class Rotor(object):
         if self.sparse is True:
             try:
                 evalues, evectors = las.eigs(
-                    A,
-                    k=self.n_eigen,
-                    sigma=0,
-                    ncv=2 * self.n_eigen,
-                    which="LM",
-                    v0=self._v0,
+                    A, k=self.n_eigen, sigma=0, ncv=2*self.n_eigen, which="LM", v0=self._v0
                 )
                 # store v0 as a linear combination of the previously
                 # calculated eigenvectors to use in the next call to eigs
@@ -1037,7 +1028,7 @@ class Rotor(object):
         --------
         """
         return signal.lsim(self.lti, F, t, X0=ic)
-
+    
     def plot_rotor(self, nodes=1, ax=None, bk_ax=None):
         """Plots a rotor object.
 
@@ -1085,22 +1076,22 @@ class Rotor(object):
 
         # bokeh plot - create a new plot
         bk_ax = figure(
-            tools="pan, box_zoom, wheel_zoom, reset, save",
-            width=900,
-            height=500,
-            y_range=[-6 * max_diameter, 6 * max_diameter],
-            title="Rotor model",
-            x_axis_label="Axial location (m)",
-            y_axis_label="Shaft radius (m)",
+           tools="pan, box_zoom, wheel_zoom, reset, save",
+           width=900,
+           height=500,
+           y_range=[-6 * max_diameter, 6 * max_diameter],
+           title="Rotor model",
+           x_axis_label='Axial location (m)',
+           y_axis_label='Shaft radius (m)'
         )
 
         # bokeh plot - plot shaft centerline
         bk_ax.line(
-            [-0.2 * shaft_end, 1.2 * shaft_end],
+            [-0.2 * shaft_end, 1.2 * shaft_end], 
             [0, 0],
             line_width=3,
             line_dash="dotdash",
-            line_color=bokeh_colors[0],
+            line_color=bokeh_colors[0]
         )
 
         # plot nodes
@@ -1135,25 +1126,23 @@ class Rotor(object):
 
         source = ColumnDataSource(dict(x=x_pos, y=y_pos, text=text))
 
-        bk_ax.square(
-            x=x_pos,
-            y=y_pos,
-            size=30,
-            angle=np.pi / 4,
-            fill_alpha=0.8,
-            fill_color=bokeh_colors[6],
-        )
-
-        glyph = Text(
-            x="x",
-            y="y",
-            text="text",
-            text_font_style="bold",
-            text_baseline="middle",
-            text_align="center",
-            text_alpha=1.0,
-            text_color=bokeh_colors[0],
-        )
+        bk_ax.square(x=x_pos,
+                     y=y_pos,
+                     size=30,
+                     angle=np.pi/4,
+                     fill_alpha=0.8,
+                     fill_color=bokeh_colors[6]
+                     )
+
+        glyph = Text(x="x",
+                     y="y",
+                     text="text",
+                     text_font_style="bold",
+                     text_baseline="middle",
+                     text_align="center",
+                     text_alpha=1.0,
+                     text_color=bokeh_colors[0]
+                     )
         bk_ax.add_glyph(source, glyph)
 
         # plot shaft elements
@@ -1681,59 +1670,6 @@ class Rotor(object):
         for node_dof in range(int(len(disp) / 4)):
             disp_y = np.append(disp_y, disp[4 * node_dof + 1])
 
-        # Shearing Force
-        BrgForce = [0] * len(self.nodes_pos)
-        DskForce = [0] * len(self.nodes_pos)
-        SchForce = [0] * len(self.nodes_pos)
-
-        for i, node in enumerate(self.df_bearings["n"]):
-            BrgForce[node] = (
-                -disp_y[node] * self.df_bearings.loc[i, "kyy"].coefficient[0]
-            )
-
-        for i, node in enumerate(self.df_disks["n"]):
-            DskForce[node] = self.df_disks.loc[i, "m"] * -9.8065
-
-        for i, node in enumerate(self.df_shaft["_n"]):
-            SchForce[node + 1] = self.df_shaft.loc[i, "m"] * -9.8065
-
-        # Shearing Force vector
-        Vx = [0] * (len(self.nodes_pos))
-        Vx_axis = []
-        for i in range(int(len(self.nodes))):
-            Vx_axis.append(self.nodes_pos[i])
-            Vx[i] = Vx[i - 1] + BrgForce[i] + DskForce[i] + SchForce[i]
-
-        for i in range(len(Vx) + len(self.df_disks) + len(self.df_bearings)):
-            if DskForce[i] != 0:
-                Vx.insert(i, Vx[i - 1] + SchForce[i])
-                DskForce.insert(i + 1, 0)
-                SchForce.insert(i + 1, 0)
-                BrgForce.insert(i + 1, 0)
-                Vx_axis.insert(i, Vx_axis[i])
-
-            if BrgForce[i] != 0:
-                Vx.insert(i, Vx[i - 1] + SchForce[i])
-                BrgForce.insert(i + 1, 0)
-                DskForce.insert(i + 1, 0)
-                SchForce.insert(i + 1, 0)
-                Vx_axis.insert(i, Vx_axis[i])
-        Vx = [x*-1 for x in Vx]
-
-        # Bending Moment vector
-        Mx = []
-        for i in range(len(Vx)-1):
-            if Vx_axis[i] == Vx_axis[i+1]:
-                pass
-            else:
-                Mx.append(((Vx_axis[i+1]*Vx[i+1]) +
-                          (Vx_axis[i+1]*Vx[i]) -
-                          (Vx_axis[i]*Vx[i+1]) -
-                          (Vx_axis[i]*Vx[i])) / 2)
-        Bm = [0]
-        for i in range(len(Mx)):
-            Bm.append(Bm[i] + Mx[i])
-
         output_file("static.html")
         source = ColumnDataSource(
             data=dict(x0=self.nodes_pos, y0=disp_y * 1000, y1=[0] * len(self.nodes_pos))
@@ -1746,7 +1682,7 @@ class Rotor(object):
             ("Displacement:", "@y0 mm"),
         ]
 
-        # create displacement plot
+        # create a new plot and add a renderer
         disp_graph = figure(
             tools=TOOLS,
             tooltips=TOOLTIPS,
@@ -1789,7 +1725,7 @@ class Rotor(object):
             fill_color=bokeh_colors[0],
         )
 
-        # create a new plot for free body diagram (FDB)
+        # create a new plot for free diagram body
         y_range = []
         for i, node in enumerate(self.df_bearings["n"]):
             y_range.append(
@@ -1797,7 +1733,7 @@ class Rotor(object):
             )
 
         shaft_end = self.nodes_pos[-1]
-        FBD = figure(
+        diagram = figure(
             tools=TOOLS,
             width=800,
             height=400,
@@ -1805,15 +1741,17 @@ class Rotor(object):
             x_axis_label="shaft lenght (m)",
             y_axis_label="Force (N)",
             x_range=[-0.1 * shaft_end, 1.1 * shaft_end],
-            y_range=[-max(y_range) * 1.4, max(y_range) * 1.4],
+            y_range=[-max(y_range) * 1.5, max(y_range) * 1.5],
         )
 
-        FBD.line("x0", "y1", source=source, line_width=5, line_color=bokeh_colors[0])
+        diagram.line(
+            "x0", "y1", source=source, line_width=5, line_color=bokeh_colors[0]
+        )
 
-        # FBD - plot arrows indicating shaft weight distribution
+        # plot arrows indicating shaft weight distribution
         sh_weight = sum(self.df_shaft["m"].values) * 9.8065
         text = str("%.1f" % sh_weight)
-        FBD.line(
+        diagram.line(
             x=self.nodes_pos,
             y=[sh_weight] * len(self.nodes_pos),
             line_width=2,
@@ -1821,7 +1759,7 @@ class Rotor(object):
         )
 
         for node in self.nodes_pos:
-            FBD.add_layout(
+            diagram.add_layout(
                 Arrow(
                     end=NormalHead(
                         fill_color=bokeh_colors[7],
@@ -1837,7 +1775,7 @@ class Rotor(object):
                 )
             )
 
-        FBD.add_layout(
+        diagram.add_layout(
             Label(
                 x=self.nodes_pos[0],
                 y=sh_weight,
@@ -1849,11 +1787,11 @@ class Rotor(object):
             )
         )
 
-        # FBD - calculate the reaction force of bearings and plot arrows
+        # calculate the reaction force of bearings and plot arrows
         for i, node in enumerate(self.df_bearings["n"]):
             Fb = -disp_y[node] * self.df_bearings.loc[i, "kyy"].coefficient[0]
             text = str("%.1f" % Fb)
-            FBD.add_layout(
+            diagram.add_layout(
                 Arrow(
                     end=NormalHead(
                         fill_color=bokeh_colors[7],
@@ -1868,7 +1806,7 @@ class Rotor(object):
                     y_end=0,
                 )
             )
-            FBD.add_layout(
+            diagram.add_layout(
                 Label(
                     x=self.nodes_pos[node],
                     y=-Fb,
@@ -1880,11 +1818,11 @@ class Rotor(object):
                 )
             )
 
-        # FBD - plot arrows indicating disk weight
+        # plot arrows indicating disk weight
         for i, node in enumerate(self.df_disks["n"]):
             Fd = self.df_disks.loc[i, "m"] * 9.8065
             text = str("%.1f" % Fd)
-            FBD.add_layout(
+            diagram.add_layout(
                 Arrow(
                     end=NormalHead(
                         fill_color=bokeh_colors[7],
@@ -1899,7 +1837,7 @@ class Rotor(object):
                     y_end=0,
                 )
             )
-            FBD.add_layout(
+            diagram.add_layout(
                 Label(
                     x=self.nodes_pos[node],
                     y=Fd,
@@ -1911,58 +1849,8 @@ class Rotor(object):
                 )
             )
 
-        # Shearing Force Diagram plot (SF)
-        source_SF = ColumnDataSource(data=dict(x=Vx_axis, y=Vx))
-        TOOLTIPS_SF = [("Shearing Force:", "@y N")]
-        SF = figure(
-            tools=TOOLS,
-            tooltips=TOOLTIPS_SF,
-            width=800,
-            height=400,
-            title="Shearing Force Diagram",
-            x_axis_label="Shaft lenght (m)",
-            y_axis_label="Force (N)",
-            x_range=[-0.1 * shaft_end, 1.1 * shaft_end],
-        )
-        SF.line("x", "y", source=source_SF, line_width=4, line_color=bokeh_colors[0])
-        SF.circle("x", "y", source=source_SF, size=8, fill_color=bokeh_colors[0])
-
-        # SF - plot centerline
-        SF.line(
-            [-0.1 * shaft_end, 1.1 * shaft_end],
-            [0, 0],
-            line_width=3,
-            line_dash="dotdash",
-            line_color=bokeh_colors[0],
-        )
-
-        # Bending Moment Diagram plot (BM)
-        source_BM = ColumnDataSource(data=dict(x=self.nodes_pos, y=Bm))
-        TOOLTIPS_BM = [("Bending Moment:", "@y N.m")]
-        BM = figure(
-            tools=TOOLS,
-            tooltips=TOOLTIPS_BM,
-            width=800,
-            height=400,
-            title="Bending Moment Diagram",
-            x_axis_label="Shaft lenght (m)",
-            y_axis_label="Bending Moment (N.m)",
-            x_range=[-0.1 * shaft_end, 1.1 * shaft_end],
-        )
-        BM.line("x", "y", source=source_BM, line_width=4, line_color=bokeh_colors[0])
-        BM.circle("x", "y", source=source_BM, size=8, fill_color=bokeh_colors[0])
-
-        # BM - plot centerline
-        BM.line(
-            [-0.1 * shaft_end, 1.1 * shaft_end],
-            [0, 0],
-            line_width=3,
-            line_dash="dotdash",
-            line_color=bokeh_colors[0],
-        )
-
         # show the results
-        grid_plots = gridplot([[FBD, SF], [disp_graph, BM]])
+        grid_plots = gridplot([[diagram], [disp_graph]])
         show(grid_plots)
 
     @classmethod
@@ -2119,8 +2007,14 @@ class Rotor(object):
         )
 
         TOOLS = "pan,wheel_zoom,box_zoom,hover,reset,save,"
-        TOOLTIPS1 = [("Frquency:", "@y0 Hz"), ("Number of Elements", "@x0")]
-        TOOLTIPS2 = [("Relative Error:", "@y1"), ("Number of Elements", "@x1")]
+        TOOLTIPS1 = [
+            ('Frquency:', '@y0 Hz'),
+            ('Number of Elements', '@x0')
+        ]
+        TOOLTIPS2 = [
+            ('Relative Error:', '@y1'),
+            ('Number of Elements', '@x1')
+        ]
         # create a new plot and add a renderer
         freq_arr = figure(
             tools=TOOLS,


Test patch:
diff --git a/ross/tests/test_disk_element.py b/ross/tests/test_disk_element.py
index 98a443c1..3ee6b683 100644
--- a/ross/tests/test_disk_element.py
+++ b/ross/tests/test_disk_element.py
@@ -1,43 +1,16 @@
 import pytest
 import numpy as np
-from numpy.testing import assert_almost_equal
+from numpy.testing import assert_almost_equal, assert_allclose
 from ross.disk_element import DiskElement
 from ross.materials import steel
 
 
 @pytest.fixture
 def disk():
-    return DiskElement(0, 0.07, 0.05, 0.32956)
-
-
-def test_mass_matrix_disk(disk):
-    # fmt: off
-    Md1 = np.array([[0.07, 0., 0., 0.],
-                    [0., 0.07, 0., 0.],
-                    [0., 0., 0.05, 0.],
-                    [0., 0., 0., 0.05]])
-    # fmt: on
-
-    assert_almost_equal(disk.M(), Md1, decimal=5)
-
-
-def test_gyroscopic_matrix_disk(disk):
-    # fmt: off
-    Gd1 = np.array([[0., 0., 0., 0.],
-                    [0., 0., 0., 0.],
-                    [0., 0., 0., 0.32956],
-                    [0., 0., -0.32956, 0.]])
-    # fmt: on
-
-    assert_almost_equal(disk.G(), Gd1, decimal=5)
-
-
-@pytest.fixture
-def disk_from_geometry():
     return DiskElement.from_geometry(0, steel, 0.07, 0.05, 0.28)
 
 
-def test_mass_matrix_disk1(disk_from_geometry):
+def test_mass_matrix_disk(disk):
     Md1 = np.array(
         [
             [32.58973, 0.0, 0.0, 0.0],
@@ -46,10 +19,10 @@ def test_mass_matrix_disk1(disk_from_geometry):
             [0.0, 0.0, 0.0, 0.17809],
         ]
     )
-    assert_almost_equal(disk_from_geometry.M(), Md1, decimal=5)
+    assert_almost_equal(disk.M(), Md1, decimal=5)
 
 
-def test_gyroscopic_matrix_disk1(disk_from_geometry):
+def test_gyroscopic_matrix_disk(disk):
     Gd1 = np.array(
         [
             [0.0, 0.0, 0.0, 0.0],
@@ -58,4 +31,4 @@ def test_gyroscopic_matrix_disk1(disk_from_geometry):
             [0.0, 0.0, -0.32956, 0.0],
         ]
     )
-    assert_almost_equal(disk_from_geometry.G(), Gd1, decimal=5)
+    assert_almost_equal(disk.G(), Gd1, decimal=5)
diff --git a/ross/tests/test_examples.py b/ross/tests/test_examples.py
index bf5a06b4..acdcd087 100644
--- a/ross/tests/test_examples.py
+++ b/ross/tests/test_examples.py
@@ -1,8 +1,9 @@
-import ross as rs
-from ross.materials import steel
+from ross import *
 import numpy as np
 import pytest
 
+steel = mtr.steel
+
 
 def rotor_example1(w=0, n_el=48):
     """
@@ -20,19 +21,19 @@ def rotor_example1(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
+            shaft.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
         )
-    disk0 = rs.DiskElement.from_geometry(
+    disk0 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5) * 0.5, material=steel, width=0.07, i_d=0.05, o_d=0.28
     )
-    disk1 = rs.DiskElement.from_geometry(
+    disk1 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5), material=steel, width=0.07, i_d=0.05, o_d=0.35
     )
 
-    bearing0 = rs.BearingElement(n=0, kxx=1e6, kyy=1e6, cxx=0, cyy=0)
-    bearing1 = rs.BearingElement(n=n_el, kxx=1e6, kyy=1e6, cxx=0, cyy=0)
+    bearing0 = bse.BearingElement(n=0, kxx=1e6, kyy=1e6, cxx=0, cyy=0)
+    bearing1 = bse.BearingElement(n=n_el, kxx=1e6, kyy=1e6, cxx=0, cyy=0)
 
-    return rs.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
+    return rotor.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
 
 
 def test_example1_w_equals_0rpm():
@@ -68,18 +69,18 @@ def rotor_example2(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
+            shaft.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
         )
-    return rs.Rotor(
+    return rotor.Rotor(
         shaft_elm,
         [
-            rs.DiskElement.from_geometry(
+            disk.DiskElement.from_geometry(
                 n=n_el, material=steel, width=0.07, i_d=0.05, o_d=0.35
             )
         ],
         [
-            rs.BearingElement(n=0, kxx=10e6, kyy=10e6, cxx=0, cyy=0),
-            rs.BearingElement(n=int((n_el / 1.5)), kxx=10e6, kyy=10e6, cxx=0, cyy=0),
+            bse.BearingElement(n=0, kxx=10e6, kyy=10e6, cxx=0, cyy=0),
+            bse.BearingElement(n=int((n_el / 1.5)), kxx=10e6, kyy=10e6, cxx=0, cyy=0),
         ],
         w=w,
     )
@@ -117,19 +118,19 @@ def rotor_example3(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
+            shaft.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
         )
-    disk0 = rs.DiskElement.from_geometry(
+    disk0 = disk.DiskElement.from_geometry(
         n=(n_el / 3), material=steel, width=0.07, i_d=0.05, o_d=0.28
     )
-    disk1 = rs.DiskElement.from_geometry(
+    disk1 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5), material=steel, width=0.07, i_d=0.05, o_d=0.35
     )
 
-    bearing0 = rs.BearingElement(n=0, kxx=1e6, kyy=8e5, cxx=0, cyy=0)
-    bearing1 = rs.BearingElement(n=n_el, kxx=1e6, kyy=8e5, cxx=0, cyy=0)
+    bearing0 = bse.BearingElement(n=0, kxx=1e6, kyy=8e5, cxx=0, cyy=0)
+    bearing1 = bse.BearingElement(n=n_el, kxx=1e6, kyy=8e5, cxx=0, cyy=0)
 
-    return rs.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
+    return rotor.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
 
 
 def test_example3_w_equals_0rpm():
@@ -163,19 +164,19 @@ def rotor_example4(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
+            shaft.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
         )
-    disk0 = rs.DiskElement.from_geometry(
+    disk0 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5) * 0.5, material=steel, width=0.07, i_d=0.05, o_d=0.28
     )
-    disk1 = rs.DiskElement.from_geometry(
+    disk1 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5), material=steel, width=0.07, i_d=0.05, o_d=0.35
     )
 
-    bearing0 = rs.BearingElement(n=0, kxx=1e6, kyy=1e6, cxx=3e3, cyy=3e3)
-    bearing1 = rs.BearingElement(n=n_el, kxx=1e6, kyy=1e6, cxx=3e3, cyy=3e3)
+    bearing0 = bse.BearingElement(n=0, kxx=1e6, kyy=1e6, cxx=3e3, cyy=3e3)
+    bearing1 = bse.BearingElement(n=n_el, kxx=1e6, kyy=1e6, cxx=3e3, cyy=3e3)
 
-    return rs.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
+    return rotor.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
 
 
 def test_example4_w_equals_0rpm():
@@ -220,19 +221,19 @@ def rotor_example5(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
+            shaft.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
         )
-    disk0 = rs.DiskElement.from_geometry(
+    disk0 = disk.DiskElement.from_geometry(
         n=(n_el / 3), material=steel, width=0.07, i_d=0.05, o_d=0.28
     )
-    disk1 = rs.DiskElement.from_geometry(
+    disk1 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5), material=steel, width=0.07, i_d=0.05, o_d=0.35
     )
 
-    bearing0 = rs.BearingElement(n=0, kxx=1e6, kyy=2e5, cxx=0, cyy=0)
-    bearing1 = rs.BearingElement(n=n_el, kxx=1e6, kyy=2e5, cxx=0, cyy=0)
+    bearing0 = bse.BearingElement(n=0, kxx=1e6, kyy=2e5, cxx=0, cyy=0)
+    bearing1 = bse.BearingElement(n=n_el, kxx=1e6, kyy=2e5, cxx=0, cyy=0)
 
-    return rs.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
+    return rotor.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
 
 
 def test_example5_w_equals4000rpm():
@@ -260,19 +261,19 @@ def rotor_example6(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
+            shaft.ShaftElement(L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.05)
         )
-    disk0 = rs.DiskElement.from_geometry(
+    disk0 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5) * 0.5, material=steel, width=0.07, i_d=0.05, o_d=0.28
     )
-    disk1 = rs.DiskElement.from_geometry(
+    disk1 = disk.DiskElement.from_geometry(
         n=(n_el / 1.5), material=steel, width=0.07, i_d=0.05, o_d=0.35
     )
 
-    bearing0 = rs.BearingElement(n=0, kxx=1e6, kyy=1e6, cxx=0, kxy=5e5, cyy=0)
-    bearing1 = rs.BearingElement(n=n_el, kxx=1e6, kyy=1e6, cxx=0, kxy=5e5, cyy=0)
+    bearing0 = bse.BearingElement(n=0, kxx=1e6, kyy=1e6, cxx=0, kxy=5e5, cyy=0)
+    bearing1 = bse.BearingElement(n=n_el, kxx=1e6, kyy=1e6, cxx=0, kxy=5e5, cyy=0)
 
-    return rs.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
+    return rotor.Rotor(shaft_elm, [disk0, disk1], [bearing0, bearing1], w=w)
 
 
 def test_example6_w_equals4000rpm():
@@ -299,19 +300,19 @@ def rotor_example7(w=0, n_el=48):
     shaft_elm = []
     for i in range(n_el):
         shaft_elm.append(
-            rs.ShaftElement(
+            shaft.ShaftElement(
                 L=1.5 / n_el, material=steel, n=i, i_d=0, o_d=0.025 + 0.015 * (i / n_el)
             )
         )
 
-    disk0 = rs.DiskElement.from_geometry(
+    disk0 = disk.DiskElement.from_geometry(
         n=(n_el / 2), material=steel, width=0.07, i_d=0.05, o_d=0.28
     )
 
-    bearing0 = rs.BearingElement(n=0, kxx=1e7, kyy=1e7, cxx=1e3, cyy=1e3)
-    bearing1 = rs.BearingElement(n=n_el, kxx=1e7, kyy=1e7, cxx=1e3, cyy=1e3)
+    bearing0 = bse.BearingElement(n=0, kxx=1e7, kyy=1e7, cxx=1e3, cyy=1e3)
+    bearing1 = bse.BearingElement(n=n_el, kxx=1e7, kyy=1e7, cxx=1e3, cyy=1e3)
 
-    return rs.Rotor(shaft_elm, [disk0], [bearing0, bearing1], w=w)
+    return rotor.Rotor(shaft_elm, [disk0], [bearing0, bearing1], w=w)
 
 
 def test_example7_w_equals3000rpm():