Skip to content

Commit

Permalink
Fixing an oopsie
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccomb committed Jan 3, 2024
1 parent ce8cc56 commit 06c5f28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion trussme/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def fos_yielding(self) -> float:
@property
def fos_buckling(self) -> float:
"""float: The factor of safety against buckling"""
return (
fos = (
-(
(numpy.pi**2)
* self.elastic_modulus
Expand All @@ -527,3 +527,5 @@ def fos_buckling(self) -> float:
)
/ self.force
)

return fos if fos > 0 else numpy.inf
2 changes: 1 addition & 1 deletion trussme/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def plot_truss(

force_colormap = matplotlib.colors.LinearSegmentedColormap.from_list(
"force",
[(1.0, 0.0, 0.0), (0.7, 0.7, 0.7), (0.0, 0.0, 1.0)],
numpy.array([[1.0, 0.0, 0.0], [0.7, 0.7, 0.7], [0.0, 0.0, 1.0]]),
)

for member in truss.members:
Expand Down

0 comments on commit 06c5f28

Please sign in to comment.