Materials and sections

NuSA 0.5 introduces reusable physical-property objects. A structural element references a nusa.material.Material and, where appropriate, a nusa.section.Section, rather than accepting individual physical parameters in its constructor.

Material

Material(E, nu=None, name=None) defines an isotropic linear-elastic material. Young’s modulus E is required and must be finite and strictly positive. Poisson’s ratio nu is optional; if provided, it must satisfy -1 < nu < 0.5. A triangle requires a material with nu defined.

from nusa import Material

steel = Material(E=210e9, nu=0.3, name="Steel")

The material exposes read-only E, nu, and name properties.

Section

Section(A=None, I=None, name=None) stores geometric section properties:

  • A: cross-sectional area, required by Bar and Truss.

  • I: second moment of area, required by Beam.

At least one is required. Both must be finite and strictly positive when provided. A section may contain both properties, but each element validates only the property it needs.

from nusa import Section

section = Section(A=2.0e-3, I=8.0e-6, name="Main member")

Properties A, I, and name are read-only.

Sharing physical properties

The same material and section can be reused across multiple elements:

from nusa import Bar, Material, Node, Section

n1 = Node((0.0, 0.0))
n2 = Node((1.0, 0.0))
n3 = Node((2.0, 0.0))

steel = Material(E=210e9)
section = Section(A=1.0e-4)

e1 = Bar((n1, n2), material=steel, section=section)
e2 = Bar((n2, n3), material=steel, section=section)

The element’s material and section references and convenience properties such as E and A are read-only.

Element requirements

Element

Construction

Bar

Bar(nodes, material=material, section=section); requires section.A

Truss

Truss(nodes, material=material, section=section); requires section.A

Beam

Beam(nodes, material=material, section=section); requires section.I

LinearTriangle

LinearTriangle(nodes, material=material, thickness=t); requires material.nu

Spring

Spring(nodes, ke); unchanged

All named physical-object arguments above are keyword-only, except the Spring stiffness argument. Boolean values (including NumPy booleans) are not valid physical scalars. Units are chosen consistently by the user; NuSA does not perform unit conversions.

API reference

class nusa.material.Material(E, nu=None, name=None)[source]

Linear-elastic isotropic material properties.

Parameters:
Efloat

Young modulus. Must be finite and strictly positive.

nufloat, optional

Poisson ratio. When provided, must satisfy -1 < nu < 0.5.

namestr, optional

Descriptive metadata for the material.

property E

Young modulus.

property name

Optional descriptive name.

property nu

Poisson ratio, or None when unspecified.

class nusa.section.Section(A=None, I=None, name=None)[source]

Cross-section properties used by structural elements.

Parameters:
Afloat, optional

Cross-sectional area.

Ifloat, optional

Second moment of area.

namestr, optional

Descriptive metadata for the section.

property A

Cross-sectional area, or None when unspecified.

property I

Second moment of area, or None when unspecified.

property name

Optional descriptive name.