Skip to content

This repository, Simple Python/Matlab/JavaScript Functions Collection, serves as a practical extension and a compilation of complementary resources for my upcoming book

Notifications You must be signed in to change notification settings

Normando1945/Simple-Python-Matlab-JavaSript-Functions-Collection

Repository files navigation

You can find me on

Web Page GitHub Carlos Celi ResearchGate Google Scholar Email

📖 Description

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.

📒 How to Use This Repository

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.

📜 List of Functions / Scripts

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. Physics and Engineering Education MSc. Ing. Carlos Celi

🔖 For Your Consideration

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

  1. Visit the Visual Studio Code official website.
  2. Click the download button for Windows.
  3. Run the downloaded .exe file to start the installation process.
  4. Follow the installation prompts:
    • Accept the license agreement.
    • Choose the installation location.
    • Select additional tasks (important: ensure 'Add to PATH' is checked).
    • Complete the installation.

Step 2: Install Python

Download and Install

  1. Go to the official Python website.
  2. Download the latest version of Python for Windows from the 'Downloads' section.
  3. Run the downloaded Python installer:
    • Check 'Add Python X.X to PATH' at the bottom of the installer.
    • Click 'Install Now'.

Step 3: Set Up Python in VSCode

Install Python Extension

  1. Open Visual Studio Code.
  2. Click on the 'Extensions' icon in the sidebar (or press Ctrl+Shift+X).
  3. Search for 'Python' and find the official Python extension by Microsoft.
  4. Click 'Install'.

Verify Python Installation

  1. Create a new file with a .py extension, e.g., test.py.
  2. Write some Python code, such as print("Hello, World!").
  3. Right-click in the file and select 'Run Python File in Terminal'.

Step 4: Install and Use Jupyter Notebooks (Optional)

Install Jupyter Extension

  1. In VSCode, go to the Extensions view (Ctrl+Shift+X).
  2. Search for 'Jupyter'.
  3. Find the Jupyter extension by Microsoft and click 'Install'.

Using Jupyter Notebooks

  1. To create a new notebook, press Ctrl+Shift+P to open the command palette.
  2. Type 'Jupyter: Create New Blank Notebook' and select it.
  3. A new notebook will open where you can write and execute Python code in cells.
  4. To run a cell, type your Python code and press Shift+Enter.

Select Python Kernel for Jupyter Notebooks

  1. With the Jupyter Notebook open, look at the top-right corner of the VSCode window.
  2. You will see the Python version currently selected. If it is not the version you want to use, click on it.
  3. A list of available Python interpreters will appear. Select the one that corresponds to the Python version you installed and want to use for your 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.

💪 Contributions

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.

About

This repository, Simple Python/Matlab/JavaScript Functions Collection, serves as a practical extension and a compilation of complementary resources for my upcoming book

htps://www.caceli.net

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages