Skip to content

aliasofsyn/Ai_PowerElectronics

Repository files navigation

Ai_PowerElectronics

This repository contains code and resources related to power electronics applications, potentially leveraging Artificial Intelligence techniques.

Key Features & Benefits

This project likely includes:

  • Power Electronics Simulations: Based on the presence of .plecs files, the repository seems to contain simulations, possibly using PLECS software.
  • AI/ML Models: The presence of .ipynb files suggests the use of Python and associated libraries (e.g., scikit-learn, PyTorch) to develop machine learning models for power electronics related tasks.
  • Data Analysis: The inclusion of files like Performance.csv indicates data analysis related to power electronics system performance.
  • Dependency Management: Uses requirements.txt for managing Python package dependencies.
  • Automated Package Installation: Includes parse_imports.py to assist with identifying and installing necessary packages.

Prerequisites & Dependencies

Before running the code in this repository, ensure you have the following installed:

  • Python: Version 3.6 or higher is recommended.
  • PLECS (Potentially): Needed to run the .plecs simulation files.
  • Python Packages: Install the required packages using pip (see instructions below).

Installation & Setup Instructions

  1. Clone the repository:

    git clone https://github.com/aliasofsyn/Ai_PowerElectronics.git
    cd Ai_PowerElectronics
  2. Install Python dependencies:

    You can use the requirements.txt file to install the necessary packages:

    pip install -r requirements.txt

    Alternatively, if you've made changes to the package list, you can regenerate requirements.txt and then install using the same command. To regenerate, you can run parse_imports.py if the notebook names have remained the same.

  3. PLECS Setup (if applicable):

    If you intend to run the PLECS simulations (.plecs files), ensure you have PLECS software installed and configured correctly. Refer to the PLECS documentation for installation instructions.

Usage Examples

Running a Jupyter Notebook

To run the Jupyter Notebooks (.ipynb files):

  1. Start a Jupyter Notebook server:

    jupyter notebook
  2. Navigate to the directory containing the notebooks and open the desired notebook (e.g., Time-series challenge.ipynb).

  3. Run the cells in the notebook to execute the code.

PLECS Simulations

Open the .plecs files (e.g., Buck_sample1.plecs) in the PLECS software to view and run the simulations.

Example Python code from parse_imports.py

import json
import re

with open("package_install.ipynb", 'r', encoding='utf-8') as f:
    notebook = json.load(f)

imports = set()
pattern = re.compile(r'^\s*(?:import|from)\s+([a-zA-Z_][\w\.]*)')

for cell in notebook['cells']:
    if cell['cell_type'] == 'code':
        for line in cell['source']:
            match = pattern.match(line)
            if match:
                root_pkg = match.group(1).split('.')[0]
                imports.add(root_pkg)

with open("requirements.txt", "w") as f:
    for package in sorted(imports):
        f.write(f"{package}\n")

This script parses a Jupyter Notebook file, extracts all import statements, and writes the unique package names to a requirements.txt file.

Configuration Options

The configuration options depend on the specific notebook or script you are using. Check the individual files for configurable parameters. For example, within the Jupyter Notebooks, parameters for model training or simulation settings can typically be adjusted.

Contributing Guidelines

We welcome contributions to this project! To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive commit messages.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository.

License Information

License information is not explicitly specified in the repository details. Please contact the repository owner to clarify the licensing terms. Assuming no explicit license, all rights are reserved.

Acknowledgments

  • We would like to acknowledge the developers of the Python packages listed in requirements.txt for their valuable contributions to the open-source community.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors