# evaluateStrain

Evaluate strain for dynamic structural analysis problem

## Syntax

``nodalStrain = evaluateStrain(structuralresults)``

## Description

````nodalStrain = evaluateStrain(structuralresults)` evaluates strain at nodal locations for all time- or frequency-steps.```

example

## Examples

collapse all

Evaluate the strain in a beam under a harmonic excitation.

Create and plot a beam geometry.

```gm = multicuboid(0.06,0.005,0.01); pdegplot(gm,FaceLabels="on",FaceAlpha=0.5) view(50,20)```

Create an `femodel` object for transient structural analysis and include the geometry into the model.

```model = femodel(AnalysisType="structuralTransient", ... Geometry=gm);```

Specify Young's modulus, Poisson's ratio, and the mass density of the material.

```model.MaterialProperties = ... materialProperties(YoungsModulus=210E9, ... PoissonsRatio=0.3, ... MassDensity=7800);```

Fix one end of the beam.

`model.FaceBC(5) = faceBC(Constraint="fixed");`

Apply a sinusoidal displacement along the y-direction on the end opposite the fixed end of the beam.

```yDisplacemenmtFunc = ... @(location, state) ones(size(location.y))*1E-4*sin(50*state.time); model.FaceBC(3) = faceBC(YDisplacement=yDisplacemenmtFunc);```

Generate a mesh.

`model = generateMesh(model,Hmax=0.01);`

Specify the zero initial displacement and velocity.

`model.CellIC = cellIC(Displacement=[0,0,0],Velocity=[0,0,0]);`

Solve the problem.

```tlist = 0:0.002:0.2; R = solve(model,tlist);```

Evaluate the strain in the beam.

`strain = evaluateStrain(R);`

Plot the normal strain along `x`-direction for the last time-step.

```figure pdeplot3D(R.Mesh,ColorMapData=strain.exx(:,end)) title("x-Direction Normal Strain in the Beam of the Last Time-Step")```

## Input Arguments

collapse all

Solution of a dynamic structural analysis problem, specified as a `TransientStructuralResults` or `FrequencyStructuralResults` object. Create `structuralresults` by using the `solve` function.

## Output Arguments

collapse all

Strain at the nodes, returned as an `FEStruct` object with the properties representing the components of strain tensor at nodal locations. Properties of an `FEStruct` object are read-only.

## Version History

Introduced in R2018a