Welcome to frame-calculator’s documentation!

About finite element method

Example 1

frame_calculator package

Submodules

frame_calculator.line module

Beam element’s stiffness calculations.

frame_calculator.line.stiffness_global(x, y, z, E, G, Ax, Iz=0, Iy=0, Ay=0, Az=0, theta=0, J=0)[source]

Generate transformed stiffness matrixes of Timoshenko beam.

It yields stiffness matrixes converted from local axes to global axes.

Parameters:
  • x (float) – x coodinate of the beam directional vector.
  • y (float) – y coodinate of the beam directional vector.
  • z (float) – z coodinate of the beam directional vector.
  • E (float) – Young’s modulus (elasticity coefficients).
  • G (float) – Shear modulus.
  • Ax (float) – Cross-sectional area.
  • Iz (float) – Moment of inertia of area around z-axis.
  • Iy (float) – Moment of inertia of area around y-axis.
  • Ay (float) – Cross-sectional area for y-axis shear stiffness.
  • Az (float) – Cross-sectional area for z-axis shear stiffness.
  • theta (float) – The rotation angle around x-axis of section (beta-angle).
  • J (float) – Polar moment of area.
Yields:

tuple – 2-dimension tuples corresponding stiffness matrixes.

frame_calculator.line.stiffness_local(L, E, G, Ax, Iz=0, Iy=0, Ay=0, Az=0, J=0)[source]

Generate stiffness matrixes of Timoshenko beam.

(TODO) Axis explaination It yields 4 matrixes M11, M12, M21, M22

Parameters:
  • L (float) – Length of the beam.
  • E (float) – Young’s modulus (elasticity coefficients).
  • G (float) – Shear modulus.
  • Ax (float) – Cross-sectional area.
  • Iz (float) – Moment of inertia of area around z-axis.
  • Iy (float) – Moment of inertia of area around y-axis.
  • Ay (float) – Cross-sectional area for y-axis shear stiffness.
  • Az (float) – Cross-sectional area for z-axis shear stiffness.
  • J (float) – Polar moment of area.
Yields:

tuple – 2-dimension tuples corresponding stiffness matrixes.

frame_calculator.matrix module

frame_calculator.matrix.transformMatrix(x, y, z, theta)[source]

frame_calculator.model module

class frame_calculator.model.Model(inputModel, allow_overwrite=False)[source]

Bases: object

effective_coodinates()[source]
effective_count()[source]
effective_indexof(node_id, coodinate)[source]
line_vector(line_id)[source]

frame_calculator.section module

Calculate cross-sectional coefficients.

This module provides functions to calculate cross-sectional coefficients, such as area, inertia, etc. Usually, convert function is just you need to convert raw parameter collections to useful coefficient collections.

Example

(TODO) calculation example.

frame_calculator.section.convert(section_parameters)[source]

Convert raw section parameters to calculated coefficients.

Calculate structural coefficients of section. Argument dictionary will be parsed according to its shape. Following shapes and functions are acceptable and used to calculate return values.

Parameters:section_parameters (dict) – Section’s shape and size. Must have ‘shape’ key and parameters corresponding the shape.
Returns:Section’s coefficients.
Return type:dict
frame_calculator.section.h(H, B, tw, tf, r=0)[source]

Calculate cross-sectional coefficients of H section.

H section is commonly used as horizontal steel beams.

Parameters:
  • H (float) – Height, or distance between the outedge of flanges.
  • B (float) – Breadth or width of the flanges.
  • tw (float) – Thickness of the web.
  • tf (float) – Thickness of the flanges. 2 flanges are assumed to have same thickness.
  • r (float, optional) – Radius of fillets. 4 fillets are assumed to have same radius.
Returns:

Dictionary having calculated cross-sectional coefficients.:

{
    'Ax': Cross-sectional area,
    'Ay': Cross-sectional area of the web,
    'Az': Cross-sectional area of flanges (total),
    'Iy': Moment of inertia around y-axis,
    'Iz': Moment of inertia around z-axis,
    'J': Polor moment of area,
    'Zy': Elastic section modulus around y-axis,
    'Zz': Elastic section modulus around z-axis,
    'iy': Radius of gyration around y-axis,
    'iz': Radius of gyration around z-axis
}
In this context,
  • x-axis direction is axial direction.
  • y-axis direction is weak-axis (parallels flanges) direction.
  • z-axis direction is strong-axis (parallels web) direction.

Return type:

dict(str, float)

frame_calculator.section.o(D, t=0)[source]

Calculate cross-sectional coefficients of circle and pipe section.

The outedge of section is assumed to be a perfect circle.

Parameters:
  • D (float) – Diameter.
  • t (float, optional) – Thickness. If t = 0, the section is considered as filled circle. Othewise as hollow.
Returns:

Dictionary having calculated cross-sectional coefficients.:

{
    'Ax': Cross-sectional area,
    'Iy': Moment of inertia around y-axis,
    'Iz': Moment of inertia around z-axis,
    'Zy': Elastic section modulus around y-axis,
    'Zz': Elastic section modulus around z-axis,
    'iy': Radius of gyration around y-axis,
    'iz': Radius of gyration around z-axis,
    'J': Polor moment of area
}

In this context, x-axis direction is axial direction.

Return type:

dict(str, float)

frame_calculator.section.properties(shape, **kwargs)[source]

Proxy to convert.

Shape and other parameters are mixed in one dictionary.

Parameters:
  • shape (str) – String represents section’s shape.
  • **kwargs – Parameters.
Returns:

Section’s coefficients.

Return type:

dict

frame_calculator.section.t(H, B, tw, tf, r=0)[source]

Calculate cross-sectional coefficients of T section.

T section is like cut off H section.

Parameters:
  • H (float) – Height, or distance between outedge of the flange and the tip of the web.
  • B (float) – Breadth or width of the flange.
  • tw (float) – Thickness of the web.
  • tf (float) – Thickness of the flange.
  • r (float, optional) – Radius of fillets. 2 fillets are assumed to have same radius.
Returns:

Dictionary having calculated cross-sectional coefficients.:

{
    'Ax': Cross-sectional area,
    'Ay': Cross-sectional area of the web,
    'Az': Cross-sectional area of the flange,
    'Iy': Moment of inertia around y-axis,
    'Iz': Moment of inertia around z-axis,
    'Zy': Elastic section modulus around y-axis,
    'Zz': Elastic section modulus around z-axis,
    'iy': Radius of gyration around y-axis,
    'iz': Radius of gyration around z-axis,
    'Cz': Distance between the outedge of the flange and the centroid.
}
In this context,
  • x-axis direction is axial direction.
  • y-axis direction is weak-axis (parallels flanges) direction.
  • z-axis direction is strong-axis (parallels web) direction.

Return type:

dict(str, float)

Module contents

Calculate structural efficients of frame structures.

This module provides functions to calculate behaivers of frame structure.

Example

(TODO) example usage.

frame_calculator.calculate(model)[source]

Calculate displacements of nodes in frame structure.

[TODO] detailed discription.

  • ‘nodes’ : { id(hashable): { x:Real, y:Real, z:Real } }
  • ‘lines’ : { id(hashable): { n1:id, n2:id, EA:Real } }
  • ‘boundaries’ : { id(hashable): { node:id, x:Real or Bool, y:Real or Bool, z:Real or Bool, rx:Real or Bool, ry:Real or Bool, rz:Real or Bool } }
  • ‘nodeLoads’ : { id(hashable): { node:id, x:Real, y:Real, z:Real, rx:Real, ry:Real, rz:Real } }
Parameters:model (dict) – Dictionary contains structure data.
Returns:Contains displacements of nodes.
Return type:dict
frame_calculator.calculated_material(material_obj, arg_names)[source]
frame_calculator.calculated_materials(materials, arg_names)[source]
frame_calculator.calculated_section(section_obj, arg_names)[source]
frame_calculator.calculated_sections(sections, arg_names)[source]
frame_calculator.fixed_coos(boundary_objs)[source]
frame_calculator.fixed_coos_of_boundary(boundary_obj)[source]
frame_calculator.get_indexes(node_id, coo_indexes)[source]
frame_calculator.index_dict(seq)[source]
frame_calculator.items(seq)[source]
>>> item = items(["x", "y", 3])
>>> next(item)
(0, 'x')
>>> next(item)
(1, 'y')
>>> next(item)
(2, 3)
>>> item = items(("a", 4, "f"))
>>> next(item)
(0, 'a')
>>> next(item)
(1, 4)
>>> next(item)
(2, 'f')
frame_calculator.keys(seq)[source]
frame_calculator.line_node_ids(line_obj)[source]
frame_calculator.line_nodes(line_obj, nodes)[source]
frame_calculator.line_vector(n1_obj, n2_obj)[source]
frame_calculator.node_vector(node_obj)[source]
frame_calculator.stiffness_node_ids(line_obj)[source]
frame_calculator.unfixed_coos(node_ids, boundary_objs)[source]
frame_calculator.values(seq)[source]