You can model an extrusion using the SimMechanics™ shape ```
General
Extrusion
```

. Examples of extrusions include the I-beam
and box-beam shapes. In this example, you model a simple solid with
I-beam shape using the `General Extrusion`

shape.
For an example that shows you how to model a box beam, see Model Box Beam.

To represent the I-beam geometry, first identify its cross-section. This is the 2-D area that SimMechanics extrudes to obtain the 3-D I-beam. You can then specify the cross-section coordinates in the Solid block dialog box. The figure shows the I-beam cross-section that you specify in this example.

The [0 0] coordinate identifies the solid reference frame origin. To place the reference frame at the center of the I-beam, specify the coordinates so that the [0 0] coordinate is at the cross-section center. Because the I-beam cross-section is symmetric about the horizontal and vertical axes, you need only define the coordinates for one cross-section half—e.g, the right half. You can then define the left half coordinates in terms of the right half coordinates.

By parameterizing the cross-section coordinates in terms of relevant I-beam dimensions, you can quickly change the I-beam dimensions without having to reenter the cross-section coordinates. The figure shows the cross-section dimensions and coordinates that you must specify to represent the I-beam.

Using the cross-section points that the figure shows, you define the coordinate matrix as:

HalfCS = [A; B; C; D; E; F]; CS = [HalfCS; -HalfCS];

At the MATLAB

^{®}command prompt, enter`smnew`

. A new SimMechanics model opens with some commonly used blocks. Delete all but the Solid block.In the Solid block dialog box, specify the following parameters. You later initialize the different MATLAB variables in a subsystem mask.

Parameter Select or Enter **Geometry**>**Shape**`General Extrusion`

**Geometry**>**Cross-Section**`CS`

, units of`cm`

**Geometry**>**Length**`L`

, units of`cm`

**Inertia**>**Density**`Rho`

**Graphic**>**Visual Properties**>**Color**`RGB`

Select the Solid block and generate a new subsystem, e.g., by pressing

**Ctrl+G**.

Select the Subsystem block and create a subsystem mask, e.g., by pressing

**Ctrl+M**.In the

**Parameters & Dialog**tab of the Mask Editor, drag six Edit boxes into the**Parameters**group and specify these parameters.Prompt Name `Length`

`L`

`Height`

`H`

`Width`

`W`

`Thickness`

`T`

`Density`

`Rho`

`Color`

`RGB`

In the

**Initialization**tab of the Mask Editor, define the cross-section coordinates and assign them to MATLAB variable`CS`

:D = H/2-T; HalfCS = [W/2, -H/2; W/2, -D; T/2, -D;... T/2, D; W/2, D; W/2, H/2]; CS = [HalfCS; -HalfCS];

In the Subsystem block dialog box, specify the numerical values of the solid properties. The table shows some values that you can enter.

Parameter Enter **Length**`10`

**Height**`4`

**Width**`2`

**Thickness**`0.2`

**Density**`2700`

**Color**`[0.85 0.45 0]`

You can now visualize the I-beam solid. To do this, look under
the Subsystem mask—e.g., by selecting the Subsystem block and
pressing **Ctrl+U**—and open the
Solid block dialog box. The solid visualization pane shows the solid
that you modeled.

Parameterizing the solid dimensions in terms of MATLAB variables enables you to modify the solid shape without having to redefine its cross-section coordinates. You can change the solid size and proportions simply by changing their values in the Subsystem block dialog box. The figure shows some examples.

Was this topic helpful?