Pynite Documentation

repository·main·Indexed 20 days ago

https://github.com/jwock82/pynite

A structural analysis library for Python. This documentation includes detailed mathematical derivations for core equations, including beam segment equations for y-axis and z-axis bending, slope-deflection equations for unknown rotations, and the DKMQ plate bending element stiffness matrix using isoparametric formulation and Gaussian Quadrature.

Tokens
25K
Snippets
74
Records
108
Agent score
72%

What's inside Pynite

  1. Organize load combinations using tags

    main

    The add_load_combo() method accepts an optional third argument, combo_tags, which allows you to categorize combinations (for example, using 'strength' or 'service').

    Tags serve two primary purposes:

    1. Analysis Filtering: When running an analysis, you can pass a list of tags to the analysis command to execute only the combinations that contain those specific tags.
    2. Result Filtering: Tags can be used to filter and organize results after the analysis is complete.
    # Example of adding a combo with tags
    my_model.add_load_combo('Strength Combo', {'D': 1.2, 'L': 1.6}, combo_tags=['strength'])
  2. Model orthotropic behavior in plates

    main

    You can model orthotropic behavior (e.g., stiffness reduction in cracked concrete) by specifying stiffness modification factors for the plate's local axes using kx_mod and ky_mod.

    • kx_mod: Modifies axial stiffness in the local x-direction.
    • ky_mod: Modifies axial stiffness in the local y-direction.

    Example: A factor of 0.35 reduces the axial stiffness in that direction by 65%.

    Warning: These modifiers are always applied in the plate's local axes. Do not use this feature if your surface contains plates with unaligned local axes.

  3. Select load combinations or load cases

    main

    To visualize results for specific loading scenarios, use combo_name or case.

    Important: These properties are mutually exclusive. Setting one will clear the other.

    • combo_name (str): Render results for a specific load combination.
    • case (str): Render results for a specific load case. Setting this automatically clears combo_name.

    Note: Deformed shapes are only available when viewing load combinations, not load cases.

    # To switch to a load case:
    my_rndr.case = 'Dead Load'
    my_rndr.combo_name = None
    
    # To switch to a load combination:
    my_rndr.combo_name = 'Load Combo 1'
    my_rndr.case = None
  4. Check for Second Order Effects using P-Delta analysis

    main

    Second order effects occur when a structure deforms under load, changing its geometry and making first-order analysis results invalid. These effects are most critical for slender members or members with high axial loads combined with bending moments.

    Pynite provides a P-Delta analysis feature to help identify these instabilities.

    Key details:

    • P-Delta analysis in Pynite is performed for members only; it is not considered for plates.
    • P-Delta is one part of a larger analysis requirement often defined by building codes (which may also require P-delta analysis, material stiffness reductions, or notional loads).
    • A model that fails P-Delta analysis may be structurally unsound.
  5. Identify and resolve Rigid Body Motion instabilities

    main

    Rigid body motion occurs when an entire structure can move as a single unit in one of the 6 degrees of freedom (3 translations and 3 rotations). This happens when there is insufficient support for the structure, resulting in a "singular" and unsolvable stiffness matrix.

    Resolution: Add supports to the model to constrain the global degrees of freedom.

  6. How PyNite mesh classes work

    main

    PyNite mesh classes provide a parametric way to generate 2D shell/plate meshes (planar or curved) that integrate directly into an FEModel3D.

    Key Benefits:

    • Parametric Creation: Generates nodes and elements with consistent numbering.
    • Automatic Integration: Nodes and elements are added to model.nodes, model.quads, or model.plates. If names collide, they are automatically renamed to unique IDs.
    • Localized Post-Processing: Each mesh object retains its own nodes and elements dictionaries, allowing you to analyze specific regions without searching the entire model.
    • Result Helpers: Includes built-in methods to find peak values (max/min) for moments, shears, and membrane stresses across specific load combinations or tags.
  7. Choose between Sparse and Dense solvers

    main

    Pynite allows you to choose between a sparse and a dense matrix solver for analysis.

    • Sparse Solver (Default): Stores only non-zero values. It is optimized for large models, using less memory and solving faster. Requires Scipy to be installed.
    • Dense Solver: Stores all values in the stiffness matrix. It is optimized for small models and can be faster if you are repeatedly solving the same small model. Does not require Scipy.

    To use the dense solver, pass sparse=False to your analysis method.

    # Example of switching to the dense solver
    model.analyze_linear(sparse=False)
  8. Choose between Rect and Quad plate elements

    main

    Pynite provides two types of plate elements depending on your geometry and thickness requirements:

    1. Rect Plate Elements:

      • Constraint: Must be strictly rectangular. Any other shape will invalidate the analysis.
      • Behavior: Uses a 12-term polynomial formulation for out-of-plane bending.
      • Best for: Accurate out-of-plane bending and shear stress results for plates that are not overly thick.
    2. Quad Plate Elements:

      • Constraint: Can be generic quadrilaterals (not limited to rectangles).
      • Behavior: Isoparametric elements based on the DKMQ formulation.
      • Best for: Both thick and thin plates. Pynite automatically "smoothes" stress results by averaging stresses from all plates connecting at a node.

    Note on In-Plane Stresses: Both element types provide accurate in-plane (membrane) stresses (tension, compression, and in-plane shear) using an isoparametric formulation.

  9. Identify and resolve Nodal Instability

    main

    Nodal instability refers to localized instabilities within a globally stabilized structure. Even if the whole structure is supported, individual nodes may have unconstrained degrees of freedom.

    Example Scenario: A node where multiple hinged-ended members meet. If all members are hinged, the node itself can spin freely.

    Resolution: Tether the rotation at the node to a member or a support. When deciding which member to tether to, consider real-world behavior: unless you are dealing with true pins, a moment applied to the joint will be transferred to the connected members.

  10. How P-Delta and P-delta effects work in Pynite

    main

    Pynite distinguishes between two types of second-order effects:

    1. P-$\Delta$ effects: Secondary forces resulting from the displacements of nodes in the model.
    2. P-$\delta$ effects: Secondary forces resulting from the displacements of individual members.

    Capturing P-$\delta$ effects

    Pynite captures P-$\delta$ effects by modeling additional nodes along the length of members. This forces the analysis to track internal member displacements at those nodes. In most cases, adding 2 or 3 intermediate nodes is sufficient.

    Analysis Procedure

    Pynite follows this iterative procedure for P-$\Delta$ analysis:

    1. Performs a simple linear-elastic analysis to calculate member axial loads.
    2. Runs the P-$\Delta$ analysis using those axial loads.
    3. Checks for tension/compression-only element and support convergence. If elements or supports are carrying loads they cannot carry, they are deactivated; if they should be carrying load but are inactive, they are reactivated. If changes occur, the process restarts from step 1.
    4. Repeats for all applicable load combinations until convergence is reached.
  11. Configure Members for Nonlinear Pushover Analysis

    main

    To capture nonlinear behavior, members must have section properties defined. Use Pynite's Sections feature to allow the solver to calculate plastic section properties.

    Note: Pynite assumes every member can develop full cross-sectional strength at every node. Ensure that your connections are designed to be as strong as the members to accommodate the forces developing at member ends.

  12. Use combo tags for enveloped results

    main

    Pynite allows you to calculate envelopes (maximums or minimums) across multiple load combinations using combo tags.

    1. Assign Tags: When creating load combinations with add_load_combo, provide a list of strings to the combo_tags argument.
    2. Retrieve Envelopes: Pass a list of tags to any max_* or min_* method.

    Return Value Behavior:

    • If a single string is passed (e.g., 'Combo 1'), the method returns a float representing the value for that specific combination.
    • If a list of tags is passed (e.g., ['Strength']), the method returns a tuple (value, governing_combo_name), where value is the enveloped result and governing_combo_name is the name of the combination that produced that value.
    # 1. Create tagged load combinations
    my_model.add_load_combo('1.4D', {'D': 1.4}, combo_tags=['Strength'])
    my_model.add_load_combo('D+L', {'D': 1.0, 'L': 1.0}, combo_tags=['Service'])
    
    # 2. Get the maximum shear across all 'Strength' combinations
    # Returns (value, governing_combo_name)
    Vmax, combo = my_model.members['M1'].max_shear('Fy', ['Strength'])
    
    # 3. Get the maximum shear for a specific combo
    # Returns float
    V_single = my_model.members['M1'].max_shear('Fy', '1.4D')