t

Análise Estrutural de um Pórtico

Recurso a Python

Luis Moura / 2018-10-13


Criação dos diagramas dos esforços e deslocamento para um pórtico, usando Python.

Introdução: Este texto, foi originalmente composto no Jupyter Notebook (Pérez and Granger 2007), usando a linguagem informática Python (Rossum and Drake 2001), sendo depois convertido para Rmarkdown (Allaire et al. 2016). Deixei visível todo o código informático que utilizei, de modo a que os resultados possam ser repetidos por outra pessoa ou simplesmente como referência para mim próprio.

Neste texto, pretendo com a ajuda da linguagem informática,1 obter o dimensionamento da armadura para uma laje.

Objectivo: Criação dos diagramas dos esforços e deslocamento para o Pórtico apresentado na figura que se segue, usando Python (Rossum and Drake 2001).

Python - livrarias necessárias

Introduzir as livrarias de Python (Rossum and Drake 2001), necessárias para este trabalho, que são Sympy (Meurer et al. 2017), AnaStruct (Vink, n.d.), Numpy (Travis E 2006) e Matplotlib.

# if using ipython notebook
%matplotlib inline
from anastruct.fem.system import SystemElements
import matplotlib.pyplot as plt
%load_ext tikzmagic

Pórtico

A imagem do Pórtico é criada usando os programas Tikz (Tantau 2013) e Stanli (Hackl 2016) para Latex (Donald E. Knuth, n.d.).

%%tikz --scale 1 --size 700,500 -f png -p stanli --save=images/estrutura_1.png
\begin{tikzpicture}
\begin{scope}[shift={(1.6,1.6)}]
\point {a }{0}{0};
\point {b }{0}{5};
\point {c }{5}{5};
\point {d }{5}{0};
\beam {1}{ a }{ b };
\beam {1}{ b }{ c };
\beam {1}{ c }{ d };
\beam {1}{ a }{ c };
\support {1}{ a };
\support {1}{ d };
\hinge {1}{ b };
\hinge {1}{ c };
\hinge {1}{ a };
\hinge {1}{ d };
\dimensioning {1}{ a }{ d }{ -1.3}[ $5 ~ m$ ];
\dimensioning {2}{ d }{ c }{ -1}[ $5 ~ m$ ];
\load{1}{ b }[180][1.2];
\dnotation {1}{ b }{ $10 ~ kN$ }[ above left =2 mm ];
\dnotation {1}{ a }{ $EA=5000kN$ }[ right =3 mm ];
\notation {4}{ a }{ b }[ $EA$ ];
\notation {4}{ b }{ c }[ $EA$ ];
\notation {4}{ d }{ c }[ $EA$ ];
\notation {4}{ c }{ a }[ $EA \sqrt{2}$ ];
\end{scope}
\end{tikzpicture}
Pórtico

Pórtico

Criação do Pórtico em Python

import math 
ss = SystemElements(EA=5000)
ss.add_truss_element(location=[[0, 0], [0, 5]])
ss.add_truss_element(location=[[0, 5], [5, 5]])
ss.add_truss_element(location=[[5, 5], [5, 0]])
ss.add_truss_element(location=[[0, 0], [5, 5]], EA=5000 * math.sqrt(2))
ss.add_support_hinged(node_id=1)
ss.add_support_hinged(node_id=4)
ss.point_load(Fx=10, node_id=2)
ss.solve()
# get a visual of the element ID's and the node ID's
ss.show_structure(scale=1, figsize=(10,6))

Reações nos apoios

# show the reaction forces
ss.show_reaction_force()

Diagrama das forças normais

# show the normal force
ss.show_axial_force()

Deslocamento

ss.show_displacement()

Diagrama do Momento Flector

ss.show_bending_moment()

Allaire, JJ, Joe Cheng, Yihui Xie, Jonathan McPherson, Winston Chang, Jeff Allen, Hadley Wickham, Aron Atkins, and Rob Hyndman. 2016. Rmarkdown: Dynamic Documents for R. http://CRAN.R-project.org/package=rmarkdown.

Donald E. Knuth, Leslie Lamport. n.d. “LaTeX - a Document Preparation System.” LaTeX3 Project; https://www.latex-project.org/.

Hackl, Jürgen. 2016. “CTAN: /Tex-Archive/Graphics/Pgf/Contrib/Stanli.” https://ctan.org/tex-archive/graphics/pgf/contrib/stanli?lang=en.

Meurer, Aaron, Christopher P. Smith, Mateusz Paprocki, Ondřej Čertík, Sergey B. Kirpichev, Matthew Rocklin, AMiT Kumar, et al. 2017. “SymPy: Symbolic Computing in Python.” PeerJ Computer Science 3 (January): e103. doi:10.7717/peerj-cs.103.

Pérez, Fernando, and Brian E. Granger. 2007. “IPython: A System for Interactive Scientific Computing.” Computing in Science and Engineering 9 (3). IEEE Computer Society: 21–29. doi:10.1109/MCSE.2007.53.

Rossum, G. Van, and F.L. Drake. 2001. “Python Reference Manual.” Virginia, USA: PythonLabs. http://www.python.org.

Tantau, Till. 2013. The Tikz and Pgf Packages: Manual for Version 3.0.0. http://sourceforge.net/projects/pgf/.

Travis E, Oliphant. 2006. “A Guide to Numpy.” http://www.scipy.org/.

Vink, Ritchie. n.d. “Welcome to anaStruct’s Documentation! — AnaStruct 1.b3 Documentation.” https://anastruct.readthedocs.io/en/latest/index.html.


  1. Fernando Pérez, Brian E. Granger, IPython: A System for Interactive Scientific Computing, Computing in Science and Engineering, vol. 9, no. 3, pp. 21-29, May/June 2007, doi:10.1109/MCSE.2007.53. URL: https://ipython.org