PyJive workshop: modal analysis#

In this notebook, the use of the ModeShapeModule for analysis of the free vibration of structures is demonstrated. It is explored how the same module can work with different models.

import numpy as np

import os
from urllib.request import urlretrieve

import sys
pyjivepath = '../../../pyjive/'
sys.path.append(pyjivepath)

if not os.path.isfile(pyjivepath + 'utils/proputils.py'):
    print('\n\n**pyjive cannot be found, adapt "pyjivepath" above or move notebook to appropriate folder**\n\n')
    raise Exception('pyjive not found')

import main
from utils import proputils as pu
from names import GlobNames as gn

%matplotlib widget
**pyjive cannot be found, adapt "pyjivepath" above or move notebook to appropriate folder**
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
Cell In[1], line 12
     10 if not os.path.isfile(pyjivepath + 'utils/proputils.py'):
     11     print('\n\n**pyjive cannot be found, adapt "pyjivepath" above or move notebook to appropriate folder**\n\n')
---> 12     raise Exception('pyjive not found')
     14 import main
     15 from utils import proputils as pu

Exception: pyjive not found
# download input files (if necessary)

def findfile(fname):
    url = "https://gitlab.tudelft.nl/cm/public/drive/-/raw/main/frequency/" + fname + "?inline=false"
    if not os.path.isfile(fname):
        print(f"Downloading {fname}...")
        urlretrieve(url, fname)

findfile("beam_frequency.pro")
findfile("solid_frequency.pro")
findfile("beam.geom")
findfile("solid.msh")
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [1], line 9
      6         print(f"Downloading {fname}...")
      7         urlretrieve(url, fname)
----> 9 findfile("beam_frequency.pro")
     10 findfile("solid_frequency.pro")
     11 findfile("beam.geom")

Cell In [1], line 5, in findfile(fname)
      3 def findfile(fname):
      4     url = "https://gitlab.tudelft.nl/cm/public/drive/-/raw/main/frequency/" + fname + "?inline=false"
----> 5     if not os.path.isfile(fname):
      6         print(f"Downloading {fname}...")
      7         urlretrieve(url, fname)

NameError: name 'os' is not defined

Case 1: Simply supported beam as 1D object#

The first case is to analyze the natural frequencies of a simply supported extensible beam where it is modeled with extensible Timoshenko beam elements.

Task 1.1: Run the 1D model and inspect results

Use the provided beam_frequency.pro and beam.geom files to compute the natural frequencies of a simply supported beam. The first eigenfrequency is reported in the text output of the simulation and multiple modes are visualized.

  • Look at modeshapemodule.py to find out where in globdat the natural frequencies are stored. Print the first 5 values that come from the analysis.

props = pu.parse_file('beam_frequency.pro')
globdat = main.jive(props)

Task 1.2: Natural frequencies for kinematically indeterminate systems

The beam has three constraints, making the problem that you just solved a kinematically and statically determinate structure.

  • What happens if one of the constraints is removed (do this by overwriting the part of the input associated with the DirichletModel)? Pay attention to the order of magnitude of the natural frequencies and look at the vibration modes.

  • And what if all three are removed (do this by removing the DirichletModel altogether)?

Case 2: Simply supported beam as 2D solid#

Now the same beam is modeled as a two-dimensional solid. Inputs are equivalent to those from Case 1.

Task 2.1: Run the 2D model and check the results

  • Compare the material and geometry inputs from solid_frequency.pro and solid.msh to those from beam_frequency.pro and beam.geom and assert that they are equivalent.

  • Look at the first natural frequencies and corresponding modes and compare them to the output from the beam analysis. What similarities and differences do you observe?

  • Look at the highest natural frequencies and corresponding modes. What determines the number of natural frequencies that is being computed?

props = pu.parse_file('solid_frequency.pro')
globdat = main.jive(props)

Task 2.2: Reconstruct the missing mode

In the previous task, you may have observed that the second mode obtained when the beam was modeled as 1D extensible Timoshenko beam is not present in results of the 2D solid analysis.

  • Adapt the 2D solid model such that you find a solution close to the second mode from the beam analysis

Tip: with the maxStep option from the ViewModule, you can limit the number of modes that is used for the interactive plot, to get better control over the slider. Additionally, the plot option of the ViewModule controls for which degree of freedom type the field is plotted.