Loading repository data…
Loading repository data…
Normando1945 / repository
This repository, Simple Python/Matlab/JavaScript Functions Collection, serves as a practical extension and a compilation of complementary resources for my upcoming book
Author: Msc. Ing. Carlos Andrés Celi Sánchez.
This repository, Simple Python Functions Collection, serves as a practical extension and a compilation of complementary resources for my upcoming book and as a supplement to the concepts and exercises developed in the classroom. Here, you will find a variety of Python functions that are simple yet fundamental, each illustrating the concepts and techniques discussed in the book's chapters and other disciplines in the field of Structural Engineering. These functions are designed to be easily understood and utilized as building blocks in more complex programs, or as didactic tools for teaching and learning Python, addressing both simple and complex problems in the intricate World of Structural Engineering.
The book associated with this repository is currently under development, and a draft of Chapter 1 is available at Draft of Chapter 1. As the book progresses, This repository will be updated to include new functions corresponding to the topics and additional examples presented in subsequent chapters, as well as exercises developed in the classroom.
Users are free to explore, download, and use any of the functions presented in this repository for their own Python projects. Readers of the book are also encouraged to use these functions as practical exercises to reinforce the concepts learned in each chapter.
Below is a table of the Python functions available in this repository:
| # | Function Name | Description | Field of Application | Author |
|---|---|---|---|---|
| 1 | fun_SHM_animation | A function to create animations for Simple Harmonic Motion (SHM). | Structural Dynamics | MSc. Ing. Carlos Celi |
| 2 | fun_BNewmark | A function that calculates the displacement, velocity, and acceleration response of a structure subjected to ground motion using the Newmark method. | Structural Dynamics | MSc. Ing. Carlos Celi |
| 3 | fun_Spec_B_Newmark_2023 | A Python function for calculating the spectral response of structures subjected to ground motion using a modified Newmark method. It includes interactive features for enhanced visualization of response spectra. | Structural Dynamics | MSc. Ing. Carlos Celi |
| 4 | fun_Nec | The fun_Nec function performs spectral calculations using the NEC-SE-DS-2015 Ecuadorian Code. | Earthquake Engineering | MSc. Ing. Carlos Celi |
| 5 | Wave_SHM | This script creates an animated visualization of multiple SHM Response superposition, demonstrating wave interference patterns. Adjustable parameters include the number of response, amplitude, and phase, allowing for a customizable experience. |
Acknowledging the significance for the readers to practically apply the mathematical concepts taught in classes, the book "Structural Engineering: Dynamics, Seismic Solution, and AI Integration" aims to bridge the gap with an introduction to basic Python programming. To facilitate this, essential instructions for navigating the VSCode environment and Python engine are thoughtfully included. While readers are encouraged to execute the various codes provided throughout the book and those hosted in this GitHub repository in their preferred environment, it is important to note that these instructions are reflective of the technological standards and installation processes as of late 2023. Thus, due to the pace of technological advancement, these guidelines may evolve over time
Installing Visual Studio Code and Python for Civil Engineering Students
This guide will help you install Visual Studio Code (VSCode) and set up Python for your coding needs in civil engineering.
Step 1: Install Visual Studio Code
Download and Install
.exe file to start the installation process.Step 2: Install Python
Download and Install
Step 3: Set Up Python in VSCode
Install Python Extension
Ctrl+Shift+X).Verify Python Installation
.py extension, e.g., test.py.print("Hello, World!").Step 4: Install and Use Jupyter Notebooks (Optional)
Install Jupyter Extension
Ctrl+Shift+X).Using Jupyter Notebooks
Ctrl+Shift+P to open the command palette.Shift+Enter.Select Python Kernel for Jupyter Notebooks
Step 5: Start Coding
You're all set! You can now begin writing Python code in Visual Studio Code. Create new .py or ipynb files and explore Python's capabilities.
While this repository is primarily for educational use and serves as a supplement to my book and as a supplement to the concepts and exercises developed in the classroom, contributions, suggestions for improvement, or new functions that align with the subjects discussed in the book are welcome. Please refer to the contribution guidelines before submitting any proposed changes.
| Physics and Engineering Education |
| MSc. Ing. Carlos Celi |
| 6 | fun_FFT_2024 | This function processes AT2 seismic record files to extract the acceleration signal, compute the Fast Fourier Transform (FFT) to identify the dominant frequency and corresponding amplitude (PGA). It then generates visualizations in both the time and frequency domains—highlighting the peak acceleration and frequency—and saves the results in a designated folder. | Signal Processing / Earthquake Engineering | MSc. Ing. Carlos Celi |
| 7 | fun_DMF_2024 | This Python function performs a comprehensive analysis of a seismic record by applying a Butterworth bandpass filter, computing its Fast Fourier Transform (FFT), and conducting a dynamic magnification study. It generates multiple visualizations that help in understanding the signal's frequency content, energy distribution, and the dynamic response characteristics relevant for seismic and structural analysis. | Signal Processing / Earthquake Engineering | MSc. Ing. Carlos Celi |