> ## Documentation Index
> Fetch the complete documentation index at: https://calcs.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Python Solvers

> Comprehensive guide to Calcs.com Python solvers for structural analysis

Python solvers are server-side calculation engines that perform complex structural analysis tasks including finite element analysis, beam analysis, cross-section calculations, and more. These solvers are accessed through Remote Widgets and provide comprehensive structural engineering calculations.

## Overview

<CardGroup cols={2}>
  <Card title="Beam Solver" href="/calcs_builder/solvers/beam_solver" icon="minus">
    1D structural analysis for beams with various support conditions and loading
  </Card>

  <Card title="Frame Solver" href="/calcs_builder/solvers/frame_solver" icon="grid">
    2D and 3D frame analysis for complex structural systems
  </Card>

  <Card title="Cross-section Solver" href="/calcs_builder/solvers/cross_section_solver" icon="circle">
    Cross-sectional property calculations for various section shapes
  </Card>

  <Card title="pyCUFSM Solver" href="/calcs_builder/solvers/pycufsm_solver" icon="wave-square">
    Constrained finite strip method analysis for buckling
  </Card>
</CardGroup>

## Beam Solver

The Beam Solver is the most commonly used solver for 1D structural analysis of beams and columns.

### Required Inputs

Most parameters are optional except that enough information must be provided to create a stable structure with:

* At least one load
* Both stiffnesses (EI and EA)
* Length
* At least 1-2 supports
* At least one strength load case/combination
* At least one serviceability load combination

### Core Parameters

<Accordion title="Geometric and Structural Properties">
  <ParamField path="L" type="scalar" required>
    Total length of beam
  </ParamField>

  <ParamField path="EI" type="scalar" required>
    Bending stiffness of beam
  </ParamField>

  <ParamField path="EA" type="scalar" required>
    Axial stiffness of beam
  </ParamField>

  <ParamField path="SW" type="scalar">
    Self-weight of beam (line load)
  </ParamField>
</Accordion>

### Support Configuration

<Accordion title="Support Types and Parameters">
  <ParamField path="r" type="matrix" required>
    Support configuration in format: `[[support_type, location, ...], ...]`

    **Support Types:**

    * `0`, `"Pin"`, or `"Pinned"` - Pinned support
    * `1`, `"Fix"`, or `"Fixed"` - Fixed support
    * `2` or `"Roller"` - Roller restraining lateral translation
    * `101` or `"Rotation"` - Support restraining only rotation
    * `102` or `"Rigid Roller"` - Roller with rotation restraint
    * `3`, `"Hinge"`, or `"Hinged"` - Internal pin
    * `4`, `"Brace"`, `"Lateral Brace"`, `"Strong Axis Brace"`, or `"Top Brace"` - Brace type 4
    * `5`, `"Brace 2"`, `"Torsional Brace"`, `"Weak Axis Brace"`, or `"Bottom Brace"` - Brace type 5
    * `6`, `"Brace 3"`, or `"Twist Brace"` - Brace type 6
  </ParamField>

  <ParamField path="rRoll" type="matrix">
    Roller support configuration: `[[support_type=2, location, angle], ...]`

    **Angles:**

    * `0°` - Restrains purely lateral translation
    * `90°` - Restrains purely axial translation
  </ParamField>

  <ParamField path="rDist" type="matrix">
    Continuous supports: `[[label, start_loc, end_loc], ...]`

    Internally creates closely-repeated pinned supports with compiled reactions
  </ParamField>
</Accordion>

### Load Inputs

<Accordion title="Load Types and Formats">
  **Concentrated Loads**

  <ParamField path="loadsConc" type="matrix">
    Linked point loads in format:

    ```
    [["label", loc, {loads_dictionary}], ...]
    [["label", loc, eccentricity, {loads_dictionary}], ...]
    [["label", loc, eccentricity, "orientation_string", {loads_dictionary}], ...]
    ```

    **Orientation strings:**

    * `"Lateral"`, `"Perpendicular"`, `"Aligned"` - 90° angle
    * `"Axial"`, `"Parallel"` - 0° angle
    * `"Global Y"` - Gravity direction
    * `"Global X"` - Perpendicular to gravity
    * `"Global"` - Gravity for beams, perpendicular for columns
  </ParamField>

  <ParamField path="loadsConcAxial" type="matrix">
    Axial-only point loads (ignores lateral components). Same format as `loadsConc`.

    Used when templates have multiple solvers for major/minor axes.
  </ParamField>

  **Distributed Loads**

  <ParamField path="loadsDist" type="matrix">
    Linked distributed loads:

    ```
    [["label", start_loc, end_loc, start_load_width, end_load_width, {loads_dictionary}], ...]
    ```
  </ParamField>
</Accordion>

### Load Combinations

<Accordion title="Load Combination Configuration">
  <ParamField path="loadTypesBase" type="array of strings" required>
    Load types in order, associated with each column in load case matrices
  </ParamField>

  <ParamField path="LCs_str" type="matrix" required>
    Strength load cases/combinations. Each row is a load case:

    * First column: String identifier (e.g., "1.2G+1.5Q")
    * Subsequent columns: Load factors for each load type
  </ParamField>

  <ParamField path="LCs_sserv" type="matrix">
    Short-term serviceability load cases/combinations
  </ParamField>

  <ParamField path="LCs_mserv" type="matrix">
    Medium-term serviceability load cases/combinations
  </ParamField>

  <ParamField path="LCs_lserv" type="matrix">
    Long-term serviceability load cases/combinations
  </ParamField>
</Accordion>

### Load Combination Factors

<Accordion title="Factor Configuration">
  <ParamField path="LCFact_DB" type="dict of arrays">
    Factor database:

    ```json theme={null}
    {"Q_conc": [0, 1.0, 0.6, 0.6, 0.3]}
    ```

    **Special prefixes:**

    * `"all_"` - Multiplies every load type by given factors
    * `"non_"` - Tracks factor but doesn't affect load combinations
  </ParamField>

  <ParamField path="LCFact_str" type="dict of arrays">
    Factor indices for strength load cases:

    ```json theme={null}
    {"Q_conc": [1, 0, 2, 4]}
    ```

    Values of 0 are ignored (effectively 1.0 factor)
  </ParamField>
</Accordion>

## Beam Solver Outputs

### Primary Results Access

All outputs are accessible via `remote.X` where `X` is the output label:

<Tabs>
  <Tab title="Governing Demands">
    ```javascript theme={null}
    remote.gov.M        // Governing moment
    remote.gov.V        // Governing shear  
    remote.gov.P        // Governing axial
    remote.gov.DST      // Short-term deflection
    remote.gov.DLT      // Long-term deflection
    ```
  </Tab>

  <Tab title="Load Cases">
    ```javascript theme={null}
    remote.govLC.M      // Load case for governing moment
    remote.LC.str.len   // Number of strength load cases
    remote.LC.str.index // Load case labels
    ```
  </Tab>

  <Tab title="Per-Span Results">
    ```javascript theme={null}
    remote.span.lengths // Array of span lengths
    remote.span.maxM    // Maximum moment in each span
    remote.span.DQ      // Live load deflection
    ```
  </Tab>

  <Tab title="Support Results">
    ```javascript theme={null}
    remote.sup.Ry       // Vertical reactions
    remote.sup.Rx       // Horizontal reactions
    remote.sup.Rm       // Moment reactions
    ```
  </Tab>
</Tabs>

### Plotting Data

<Accordion title="Plot Data Structure">
  ```javascript theme={null}
  remote.plot.x       // X-axis locations
  remote.plot.M       // Moment diagram data
  remote.plot.V       // Shear diagram data  
  remote.plot.D       // Deflection data
  remote.plot.MEnv    // Moment envelope
  remote.plot.R       // Support/brace locations
  ```
</Accordion>

### Load Linking

<Accordion title="Linking Outputs">
  <ParamField path="RLinkTable" type="matrix">
    Support reactions table for load-linking between templates
  </ParamField>

  <ParamField path="RLink" type="dictionary">
    Support reactions dictionary: `[Rx, Ry, Rm]`
  </ParamField>

  <ParamField path="RLinkY" type="dictionary">
    Vertical reactions dictionary: `[Ry, Rm]`
  </ParamField>
</Accordion>

## Advanced Features

### Load Patterning

<ParamField path="loadPattern" type="array of strings">
  Load types to be patterned (e.g., `["L", "S"]`)
</ParamField>

<ParamField path="loadPatternBasis" type="string" default="supports">
  Pattern basis: `"supports"`, `"braces"`, or `"Brace X"`
</ParamField>

### Non-Concurrent Loads

<ParamField path="combNonConc" type="array of mixed array">
  Expand load types for non-concurrent analysis:

  ```json theme={null}
  [["Q_dist", 2]]
  ```

  Creates "Q\_dist2" and "Q\_dist3" for separate analysis
</ParamField>

### Unit Conversion

<ParamField path="len_convert" type="scalar" default="0.001">
  Length unit conversion factor
</ParamField>

<ParamField path="forceUnit" type="string">
  Force unit for outputs (must be valid mathjs unit, e.g., 'kN', 'kip')
</ParamField>

<ParamField path="lengthUnit" type="string">
  Length unit for outputs (must be valid mathjs unit, e.g., 'm', 'ft')
</ParamField>

## Important Notes

<Warning>
  **Non-Concurrent Load Cases**: For outputs with "byLC" suffix, non-concurrent load combinations (e.g., "Eh2") are added at the END of results. Use `LC.str.len` for table length, not `LCTable.str.len`.
</Warning>

<Note>
  **Parameter Evolution**: Some parameters are deprecated but still functional. New templates should use current parameter formats (e.g., `combConc2` instead of `combConc`).
</Note>

## Best Practices

<Tip>
  * Always provide sufficient boundary conditions for structural stability
  * Use meaningful load case labels that match code requirements
  * Set appropriate units for consistent output formatting
  * Test solver inputs with simple cases before complex implementations
  * Document any special load combination factor requirements
  * Consider performance implications with large numbers of load cases
</Tip>

## Other Solvers

### Frame Solver

For 2D and 3D frame analysis with multiple members and complex connections.

### Cross-section Solver

Calculates section properties for various cross-sectional shapes including custom polygonal sections.

### pyCUFSM Solver

Performs constrained finite strip method analysis for buckling calculations of thin-walled sections.

<Note>
  Each solver has specific input requirements and output formats. Refer to the individual solver documentation for detailed parameter specifications.
</Note>
