Skip to content

Commit

Permalink
Merge pull request #66 from robbievanleeuwen/mi_enhancements
Browse files Browse the repository at this point in the history
Moment Interaction Diagram Usability Enhancements
robbievanleeuwen authored Nov 18, 2022
2 parents ba572cf + 1010227 commit ab9748a
Showing 8 changed files with 576 additions and 243 deletions.
410 changes: 239 additions & 171 deletions concreteproperties/concrete_section.py

Large diffs are not rendered by default.

63 changes: 38 additions & 25 deletions concreteproperties/design_codes/as3600.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

from copy import deepcopy
from math import inf
from typing import TYPE_CHECKING, List, Tuple, Union
from typing import TYPE_CHECKING, List, Optional, Tuple, Union

import concreteproperties.results as res
import concreteproperties.stress_strain_profile as ssp
@@ -369,7 +369,6 @@ def non_linear_phi(phi_guess):
f_mi_res, _, _ = self.moment_interaction_diagram(
theta=theta,
control_points=[
("D", 1.0),
("N", 0.0),
],
n_points=2,
@@ -437,37 +436,49 @@ def non_linear_phi(phi_guess):
def moment_interaction_diagram(
self,
theta: float = 0,
control_points: List[Tuple[str, float]] = [
limits: List[Tuple[str, float]] = [
("D", 1.0),
("fy", 1.0),
("N", 0.0),
],
labels: List[Union[str, None]] = [None],
n_points: Union[int, List[int]] = [12, 12],
control_points: List[Tuple[str, float]] = [
("fy", 1.0),
],
labels: Optional[List[str]] = None,
n_points: int = 24,
n_spacing: Optional[int] = None,
phi_0: float = 0.6,
progress_bar: bool = True,
) -> Tuple[res.MomentInteractionResults, res.MomentInteractionResults, List[float]]:
r"""Generates a moment interaction diagram with capacity factors to AS 3600:2018.
r"""Generates a moment interaction diagram with capacity factors to
AS 3600:2018.
See :meth:`concreteproperties.concrete_section.moment_interaction_diagram` for
allowable control points.
:param theta: Angle (in radians) the neutral axis makes with the horizontal axis
(:math:`-\pi \leq \theta \leq \pi`)
:param control_points: List of control points over which to generate the
interaction diagram. Each entry in ``control_points`` is a ``Tuple`` with
the first item the type of control point and the second item defining the
location of the control point. Acceptable types of control points are
``"D"`` (ratio of neutral axis depth to section depth), ``"d_n"`` (neutral
axis depth), ``"fy"`` (yield ratio of the most extreme tensile bar), ``"N"``
(axial force) and ``"kappa"`` (zero curvature compression - must be at start
of list, second value in tuple is not used). Control points must be defined
in an order which results in a decreasing neutral axis depth (decreasing
axial force). The default control points define an interaction diagram from
the decompression point to the pure bending point.
:param labels: List of labels to apply to the ``control_points`` for plotting
purposes, length must be the same as the length of ``control_points``. If a
single value is provided, will apply this label to all control points.
:param n_points: Number of neutral axis depths to compute between each control
point. Length must be one less than the length of ``control_points``. If an
integer is provided this will be used between all control points.
:param limits: List of control points that define the start and end of the
interaction diagram. List length must equal two. The default limits range
from concrete decompression strain to zero curvature tension.
:param control_points: List of additional control points to add to the moment
interaction diagram. The default control points include the pure
compression point (``kappa0``), the balanced point (``fy=1``) and the pure
bending point (``N=0``). Control points may lie outside the limits of the
moment interaction diagram as long as equilibrium can be found.
:param labels: List of labels to apply to the ``limits`` and ``control_points``
for plotting purposes. The first two values in ``labels`` apply labels to
the ``limits``, the remaining values apply labels to the ``control_points``.
If a single value is provided, this value will be applied to both ``limits``
and all ``control_points``. The length of ``labels`` must equal ``1`` or
``2 + len(control_points)``.
:param n_points: Number of points to compute including and between the
``limits`` of the moment interaction diagram. Generates equally spaced
neutral axes between the ``limits``.
:param n_spacing: If provided, overrides ``n_points`` and generates the moment
interaction diagram using ``n_spacing`` equally spaced axial loads. Note
that using ``n_spacing`` negatively affects performance, as the neutral axis
depth must first be located for each point on the moment interaction
diagram.
:param phi_0: Compression dominant capacity reduction factor, see Table 2.2.2(d)
:param progress_bar: If set to True, displays the progress bar
@@ -477,9 +488,11 @@ def moment_interaction_diagram(

mi_res = self.concrete_section.moment_interaction_diagram(
theta=theta,
limits=limits,
control_points=control_points,
labels=labels,
n_points=n_points,
n_spacing=n_spacing,
progress_bar=progress_bar,
)

@@ -547,7 +560,7 @@ def biaxial_bending_diagram(
"""Generates a biaxial bending with capacity factors to AS 3600:2018.
:param n: Net axial force
:param n_points: Number of calculation points between the decompression
:param n_points: Number of calculation points
:param phi_0: Compression dominant capacity reduction factor, see Table 2.2.2(d)
:param progress_bar: If set to True, displays the progress bar
18 changes: 16 additions & 2 deletions concreteproperties/results.py
Original file line number Diff line number Diff line change
@@ -559,7 +559,7 @@ def get_curvature(
return float(f_kappa(moment))


@dataclass
@dataclass(order=True)
class UltimateBendingResults:
r"""Class for storing ultimate bending results.
@@ -588,7 +588,7 @@ class UltimateBendingResults:
m_xy: float = 0

# label
label: Optional[str] = None
label: Optional[str] = field(default=None, compare=False)

def print_results(
self,
@@ -629,6 +629,20 @@ class MomentInteractionResults:

results: List[UltimateBendingResults] = field(default_factory=list)

def sort_results(self) -> None:
"""Sorts the results by decreasing axial force."""

self.results.sort(reverse=True)

# remove duplicates from sorted list
new_results = []

for res in self.results:
if res not in new_results:
new_results.append(res)

self.results = new_results

def get_results_lists(
self,
moment: str,
Loading

0 comments on commit ab9748a

Please sign in to comment.