ross.Material

class ross.Material(name, rho, E=None, G_s=None, Poisson=None, color='#525252', **kwargs)

Material used on shaft and disks.

Class used to create a material and define its properties. Density and at least 2 arguments from E, G_s and Poisson should be provided.

You can run rs.Material.available_materials() to get a list of materials already provided.

Parameters
namestr

Material name.

rhofloat, pint.Quantity

Density (N/m**3).

Efloat, pint.Quantity

Young’s modulus (N/m**2).

G_sfloat,

Shear modulus (N/m**2).

Poissonfloat

Poisson ratio (dimensionless).

colorstr

Color that will be used on plots.

Examples

>>> AISI4140 = Material(name="AISI4140", rho=7850, E=203.2e9, G_s=80e9)
>>> Steel = Material(name="Steel", rho=7810, E=211e9, G_s=81.2e9)
>>> AISI4140.Poisson
0.27

Methods

__init__(name, rho, E=None, G_s=None, Poisson=None, color='#525252', **kwargs)
static available_materials()

Return a list of all saved material’s name.

Returns
available_materialslist

A list containing all saved material’s names.

Examples

>>> import ross as rs
>>> steel = rs.Material.load_material('Steel')
>>> steel.name = 'test_material'
>>> steel.save_material()
>>> steel.remove_material('test_material')
static dump_data(data)

Save material properties.

This is an auxiliary function to save the materials properties in the save method.

Parameters
datadict

Dictionary containing all data needed to instantiate the Object.

static get_data()

Load material properties.

This is an auxiliary function to load all saved materials properties in the load_material method.

Returns
datadict

Containing all data needed to instantiate a Material Object.

static load_material(name)

Load a material that is available in the data file.

Returns
ross.Material

An object with the material properties.

Raises
KeyError

Error raised if argument name does not match any material name in the file.

Examples

>>> import ross as rs
>>> steel = rs.Material.load_material('Steel')
static remove_material(name)

Delete a saved ross.Material.

Parameters
namestring

Name of Material Object to be deleted.

Examples

>>> import ross as rs
>>> steel = rs.Material.load_material('Steel')
>>> steel.name = 'test_material'
>>> steel.save_material()
>>> steel.remove_material('test_material')
save_material()

Save the material in the available_materials list.