Main Content

pdesmech

(Not recommended) Calculate structural mechanics tensor

pdesmech is not recommended. Use the PDE Modeler app or the Structural Mechanics workflow instead. For more information, see Compatibility Considerations.

Description

example

structMechT = pdesmech(p,t,c,u,Name,Value) returns a tensor evaluated at the center of each triangle in t. The tensors are stresses and strains for structural mechanics applications with plane stress or plane strain conditions. If you do not specify Name,Value, the function returns the von Mises effective stress for plane stress conditions.

Export the solution, the mesh, and the PDE coefficients to the MATLAB® workspace. Then use pdesmech for postprocessing of a solution computed in one of the structural mechanics application modes of the PDE Modeler app.

When calculating shear stresses and strains and the von Mises effective stress in plane strain mode, specify Poisson's ratio.

Examples

collapse all

Solve a structural mechanics problem in the PDE Modeler app, and export the solution to the MATLAB workspace. Then use pdesmech to compute the x-component of the stress and the von Mises effective stress.

Consider a steel plate that is clamped along a right-angle inset at the lower-left corner, and pulled along a rounded cut at the upper-right corner. All other sides are free. The steel plate has these properties:

  • Dimensions are 1-by-1-by-0.001 m.

  • Inset is 1/3-by-1/3 m.

  • Rounded cut runs from (2/3, 1) to (1, 2/3).

  • Young's modulus is 196 · 103 (MN/m2).

  • Poisson's ratio is 0.31.

The curved boundary is subjected to an outward normal load of 500 N/m. To specify a surface traction, divide the load by the thickness (0.001 m). Thus, the surface traction is 0.5 MN/m2. The force unit in this example is MN.

Draw a polygon with corners (0, 1), (2/3, 1), (1, 2/3), (1, 0), (1/3, 0), (1/3, 1/3), (0, 1/3) and a circle with the center (2/3, 2/3) and radius 1/3.

pdepoly([0 2/3 1 1 1/3 1/3 0],[1 1 2/3 0 0 1/3 1/3])
pdecirc(2/3,2/3,1/3)

Set the x-axis limit to [-0.5 1.5] and y-axis limit to [0 1.2]. To do this, select Options > Axes Limits and set the corresponding ranges.

Model the geometry by entering P1+C1 in the Set formula field.

Set the application mode to Structural Mechanics, Plane Stress.

Remove all subdomain borders. To do this, switch to the boundary mode by selecting Boundary > Boundary Mode. Then select Boundary > Remove All Subdomain Borders.

Display the edge labels by selecting Boundary > Show Edge Labels.

PDEModeler app window showing boundaries of the geometry with the edge labels

Specify the boundary conditions. To do this, select Boundary > Specify Boundary Conditions.

  • For convenience, first specify the Neumann boundary condition: g1 = g2 = 0, q11 = q12 = q21 = q22 = 0 (no normal stress) for all boundaries. Use Edit > Select All to select all boundaries.

  • For the two clamped boundaries at the inset in the lower left (edges 4 and 5), specify the Dirichlet boundary condition with zero displacements: h11 = 1, h12 = 0, h21 = 0, h22 = 1, r1 = 0, r2 = 0. Use Shift+click to select several boundaries.

  • For the rounded cut (edge 7), specify the Neumann boundary condition: g1 = 0.5*nx, g2 = 0.5*ny, q11 = q12 = q21 = q22 = 0.

Specify the coefficients by selecting PDE > PDE Specification or clicking the PDE button on the toolbar. Specify E = 196E3 and nu = 0.31. The material is homogeneous, so the same values E and nu apply to the entire 2-D domain. Because there are no volume forces, specify Kx = Ky = 0. The elliptic type of PDE for plane stress does not use density, so you can specify any value. For example, specify rho = 0.

Initialize the mesh by selecting Mesh > Initialize Mesh. Refine the mesh by selecting Mesh > Refine Mesh.

Further refine the mesh in areas where the gradient of the solution (the stress) is large. To do this, select Solve > Parameters. In the resulting dialog box, select Adaptive mode. Use the default adaptation options: the Worst triangles triangle selection method with the Worst triangle fraction set to 0.5.

Solve the PDE by selecting Solve > Solve PDE or by clicking the = button on the toolbar.

Export the PDE coefficients, mesh, and solution to the MATLAB workspace.

  • To export the PDE coefficients, select PDE > Export PDE Coefficients.

  • To export the mesh, select Mesh > Export Mesh.

  • To export the solution, select Solve > Export Solution.

Find the x-component of the stress using the pdesmech function.

sx = pdesmech(p,t,c,u,'tensor','sxx');

Plot the result.

pdeplot(p,e,t,'XYData',sx,'Mesh','on')

x-component of the stress

Find and plot the von Mises effective stress.

vM = pdesmech(p,t,c,u,'tensor','vonmises');
pdeplot(p,e,t,'XYData',vM,'Mesh','on')

von Mises stress

Input Arguments

collapse all

Mesh nodes, specified as a 2-by-Np matrix of nodes (points), where Np is the number of nodes in the mesh. For details on the mesh data representation, see initmesh.

Data Types: double

Mesh elements, specified as a 4-by-Nt matrix of triangles, where Nt is the number of triangles in the mesh. For details on the mesh data representation, see initmesh.

Data Types: double

PDE coefficient, specified as a scalar, matrix, character vector, character array, string scalar, string vector, or coefficient function.

Data Types: double | char | string | function_handle

PDE solution, specified as a column vector of 2Np elements, where Np is the number of nodes in the mesh. The first Np elements of u represent the x-displacement, and the next Np elements represent y-displacement.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: vM = pdesmech(p,t,c,u,'tensor','ux');

Tensor expression, specified as one of these values:

  • 'vonmises' – von Mises effective stress for plane stress conditions

    σ12+σ22σ1σ2

    or for plane strain conditions

    (σ12+σ22)(v2v+1)+σ1σ2(2v22v1)

    where v is Poisson’s ratio nu.

  • 'ux'x-gradient of u-displacement

  • 'uy'y-gradient of u-displacement

  • 'vx'x-gradient of v-displacement

  • 'vy'y-gradient of v-displacement

  • 'exx' – Normal strain along x-direction

  • 'eyy' – Normal strain along y-direction

  • 'exy' – Shear strain

  • 'sxx' – Normal stress along x-direction

  • 'syy' – Normal stress along y-direction

  • 'sxy' – Shear stress

  • 'e1' – First principal strain

  • 'e2' – Second principal strain

  • 's1' – First principal stress

  • 's2' – Second principal stress

Data Types: char | string

Plane stress or plane strain application, specified as 'ps' or 'pn'.

Data Types: char | string

Poisson's ratio, specified as a number, vector, character vector, or string scalar. The pdesmech function uses the value of Poisson's ratio to calculate shear stresses and strains, and the von Mises effective stress in the plane strain mode. Specify a scalar if the value is constant over the entire geometry. Otherwise, specify a row vector whose length is equal to the number of elements, a character vector, or a string scalar in coefficient form.

Output Arguments

collapse all

Resulting tensor, returned as a vector. Depending on the value of the tensor input argument, the result is one of these values:

  • von Mises effective stress

  • x- or y-component of displacement gradients

  • normal stress or strain

  • shear stress or strain

  • first or second principal stress

  • first or second principal strain

Version History

Introduced before R2006a

collapse all

R2016a: Not recommended

pdesmech is not recommended. Use the PDE Modeler app instead. There are no plans to remove pdesmech.

Starting in R2016a, use the PDE Modeler app to calculate stresses and strains for structural mechanics applications with plane stress or plane strain conditions. For example, see von Mises Effective Stress and Displacements: PDE Modeler App. Alternatively, starting in R2017b, you can use the recommended structural mechanics workflow. For details, see Structural Mechanics.