Beam-Spring-Mass

This example demonstrates modeling a beam with a finite element analysis and computing its spring constant. This will be done by setting up a partial differential equation (PDE) model, through the solid mechanics model framework provided by SolidMechanicsPDEComponent. The spring constant will then be used in a simple mass-spring system model.

The general idea is the following: Create a geometry of a beam. Then set up a PDE model where the beam is constrained at one side and apply a downward force at the other side. For a specific force, the displacement of the beam will be computed. This will be done for several forces and result in several displacements associated with the forces. This data allows for the creation of a force/displacement plot and the computation of the spring constant.

Load the finite element package and set the $HistoryLength to 0:

Beam Geometry

The first step for a finite element analysis is to generate the geometric model.

Create a beam geometry:

Mesh Generation

Create a mesh of the geometry:
Visualize the mesh:

FEM Model    

Next, set up the PDE model. This will be done through the SolidMechanicsPDEComponent. For more information, please refer to the SolidMechanicsPDEComponent reference page or the solid mechanics monograph explaining the functionality available at great length.

Choose the material data of a vulcanized rubber. There are two dependent variables, also called field variables, and , which represent the displacement of the beam in the two spatial dimensions.

Two models are made: In the first model, a linear elastic material model is used. Later, in the second case, a hyperelastic material model is used.

Set up a solid mechanics component:

Next, boundary conditions are discussed.

Set the beam to be fixed on the left:
Set up a downward parametric force on the right end of the beam:

Solver

To solve the PDE, set up a parametric solver. The force in the boundary load is the parameter that is varied.

Make a parametric solver for the downward force:
Evaluate the parametric function for various forces and store the associated displacements:
Visualize the full displacement of the spring for the largest force:

Force-Displacement Plot

In order to compute the spring constant, a force/displacement plot is created.

Set a point in the geometry:

Compute the magnitude of the displacement and record that for the forces applied.

Evaluate the magnitude of displacement at this point for the various displacement solutions:

Since the material model is linear elastic, the force displacement relation is also linear. To compute the spring constant, an interpolating function is created and the derivative is computed.

Create an interpolating function from the data:
Visualize the interpolation function:
Compute the derivative:
Plot the spring constant:

Note that the result is curved. This, however, is a numerical artifact. The axis is the same constant value, and the plotting function tries to show even the smallest change in value.

Inspect the actual values of the interpolating function:
Compute the spring constant as the mean of the data:

Spring-Mass System Model

In this section, the just-computed spring constant is used in a system mass-spring model. Since the model is simple, it is created in the Wolfram Language.

Compute the mass of the beam:
Collect spring-mass system model components:
Create a system model connection:
Connect the components and set initial values for the spring constant and mass and the initial displacement:
Show how the mass position oscillates:
Show the force on the beam at various times:

Hyperelastic Beam

Vulcanized rubber is better modeled through a hyperelastic material model, such as a neo-Hookean model. More information on this can be found in the "Hyperelasticity" monograph.

Set up a hyperelastic material model:
Set up the PDE operator:

The boundary conditions are the same as above.

Evaluate the parametric function for various forces and store the associated displacements:
Visualize the full displacement of the spring for the largest force:

Force-Displacement Plot

For the force-displacement plot, compute the magnitude of the displacement and record it together with the forces.

Evaluate the magnitude of the displacement at this point for the various displacement solutions:

Now, the force-displacement relation is no longer linear.

Create an interpolating function from the data:
Visualize the interpolation function:
Compute the derivative:
Plot the spring constant:
Inspect the actual values of the interpolating function:

The spring "constant" is now no longer constant.

Nonlinear Spring

To make use of the nonlinear spring data, proceed differently than in the linear case. In this case, create a custom model in System Modeler. After creating a nonlinear model in System Modeler, import it here.

Import the system model:

In this approach, adjust the linear force-displacement relationship of the default spring component to reflect a nonlinear behavior. The linear spring constant is replaced with forceDisplacement data that is added in this custom spring component.

Extract and inspect the nonlinear spring model:

This data is provided by using the table shown in the diagram view below, which contains the data characterizing the nonlinear force-displacement relationship specific to a vulcanized hyperelastic rubber beam.

Visualize the nonlinear spring as a diagram:
Inspect the available variables in the model:

What remains to be done is to assign the nonlinear spring data to the system model. The data will be assigned the variable "SpringNonlinear.nonlinearSpring.forceDisplacement".

Assign the force-displacement curve of the nonlinear spring component:
Simulate the nonlinear spring model in System Modeler:
Extract the position of and the force on the spring:
Visualize the displacement versus the force:

There are two main things to keep in mind. First, you will see negative forces and movements in the results, but these did not come from the original model of the rubber beam. This happens because the modeling tool, the System Modeler, fills in these negative values by itself, using the closest positive values it has from the model. Second, you will notice that when the beam moves more (positive displacement), the force needed to move it also goes up. This means the beam gets harder to bend the more it is stretched.

Show how the mass position oscillates:
Show the force on the beam:

Compare the hyperelastic spring to the linear elastic model of the spring.

Compare the displacements of the spring computed with the linear and the nonlinear material model:
Compare the forces acting on the spring computed with the linear and the nonlinear material model:

Given that the nonlinear model, represented in red, is more rigid compared to the linear model, its eigenfrequencies are higher than those of the linear model. Consequently, the displacement period in the nonlinear model is shorter than in the linear model. Additionally, the nonlinear model can withstand greater forces than the linear spring at the same level of displacement, as illustrated above.

This example demonstrates how the complexity of nonlinear PDE dynamics can be effectively simplified and captured in system-level modeling through the combined use of System Modeler and Mathematica.