{"id":28615922,"url":"https://github.com/powergridmodel/ict-workshop-newton-raphson","last_synced_at":"2025-06-12T02:10:44.102Z","repository":{"id":272457468,"uuid":"916653836","full_name":"PowerGridModel/ict-workshop-newton-raphson","owner":"PowerGridModel","description":"Experimental code for Newton Raphson initial value problem","archived":false,"fork":false,"pushed_at":"2025-01-18T15:34:15.000Z","size":48,"stargazers_count":1,"open_issues_count":2,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-08T14:02:01.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerGridModel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-14T14:18:14.000Z","updated_at":"2025-01-18T15:34:16.000Z","dependencies_parsed_at":"2025-01-14T15:44:31.773Z","dependency_job_id":"0ed9d687-84df-42db-b62d-33d802795ca1","html_url":"https://github.com/PowerGridModel/ict-workshop-newton-raphson","commit_stats":null,"previous_names":["powergridmodel/ict-workshop-newton-raphson"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PowerGridModel/ict-workshop-newton-raphson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerGridModel%2Fict-workshop-newton-raphson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerGridModel%2Fict-workshop-newton-raphson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerGridModel%2Fict-workshop-newton-raphson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerGridModel%2Fict-workshop-newton-raphson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerGridModel","download_url":"https://codeload.github.com/PowerGridModel/ict-workshop-newton-raphson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerGridModel%2Fict-workshop-newton-raphson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259382356,"owners_count":22848845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T02:10:42.489Z","updated_at":"2025-06-12T02:10:44.083Z","avatar_url":"https://github.com/PowerGridModel.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ICT with Industry Workshop\nExperimental repo for Newton Raphson initial value problem\n\n## Getting Started\n\n### Installation of Python\n\n#### Windows\n1. Download the latest version of Python from the [official website](https://www.python.org/downloads/).\n2. Run the installer and ensure you check the box \"Add Python to PATH\".\n3. Follow the installation steps.\n\n#### macOS\n1. Download the latest version of Python from the [official website](https://www.python.org/downloads/).\n2. Open the downloaded package and follow the installation steps.\n\n#### Linux\n1. Open a terminal.\n2. Install Python using your package manager. For example, on Debian-based systems:\n    ```sh\n    sudo apt update\n    sudo apt install python3\n    ```\n\n### Creating a Virtual Environment\n\n1. Open a terminal or command prompt.\n2. Navigate to your project directory:\n    ```sh\n    cd /path/to/your/project\n    ```\n3. Create a virtual environment using the `venv` module:\n    ```sh\n    python3 -m venv .venv\n    ```\n\n### Activating the Virtual Environment\n\n#### Windows\n```sh\n.\\.venv\\Scripts\\activate\n```\n\n#### macOS and Linux\n```sh\nsource .venv/bin/activate\n```\n\n### Installing Packages\n\n1. Ensure your virtual environment is activated.\n2. Install the required packages from `requirements.txt`:\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n## Included Notebooks\n\n### pandapower_init_and_internals.ipynb\nThis notebook provides an introduction to the `pandapower` library, including its initialization and internal workings. It is designed to help you understand the basics of power system modeling and analysis using `pandapower` in terms of accessing internal states and specify initial states. More detailed tutorial can be found via the [official website](https://www.pandapower.org/).\n\n### pipeline_dnn.ipynb\nThis notebook demonstrates the implementation of a deep neural network (DNN) pipeline. It includes data preprocessing, model training, and evaluation steps. It is intended to guide you through the process of building and deploying a DNN model in the context of `pandapower` for your project.\n\n## Data\nThis repository includes four base network and functionality to generate training networks based on parameterization of key parameters.\n\n### Data structure\nThe data generation is handled by the `net_gen.py` script, which uses the definitions provided in `simple_net/transformer_high_pu.py`,  `simple_net/high_generation_injection.py` `complete_net/high_generation_segmented_grid.py` and `complete_net/transformer_high_pu_segmented_grid.py` to create networks with varying parameters.\n\n#### Base Networks\n1. **High Generation Injection Network (`HighGenInjectionNet`)**\n   - This network simulates a high generation injection scenario.\n   - It consists of:\n     - A source bus at 10kV (node_0).\n     - A line with 1 ohm resistance connecting to another bus (node_1).\n     - A load connected to node_1.\n   - Parameters:\n     - `vm_pu`: Voltage magnitude at the external grid bus.\n     - `p_mw`: Active power generation.\n     - `q_mvar`: Reactive power generation.\n     - `init_vm_pu`: Initial voltage magnitudes for the power flow calculation.\n\n2. **Transformer High PU Network (`TrafoHighPuNet`)**\n   - This network simulates a transformer with high per-unit values.\n   - It consists of:\n     - Two buses at 10kV.\n     - A transformer connecting the two buses.\n     - An external grid connected to the first bus.\n     - A load connected to the second bus.\n   - Parameters:\n     - `vm_pu`: Voltage magnitude at the external grid bus.\n     - `p_mw`: Active power load.\n     - `q_mvar`: Reactive power load.\n     - `vn_lv_kv`: Low voltage side nominal voltage of the transformer.\n     - `init_vm_pu`: Initial voltage magnitudes for the power flow calculation.\n\n3. **Large Networks with High Generation Injection (`HighGenSegmentedNet`)**\n   - This network simulates a high generation injection scenario with multiple segments.\n   - It consists of:\n     - A source bus at 10kV.\n     - Multiple segments with lines and distributed generation.\n     - An external grid connected to the first bus.\n   - Parameters:\n     - `vm_pu`: Voltage magnitude at the external grid bus.\n     - `total_p_gen`: Total active power generation distributed across segments.\n     - `total_q_gen`: Total reactive power generation distributed across segments.\n     - `p_mw`: Active power generation at the last bus.\n     - `q_mvar`: Reactive power generation at the last bus.\n     - `init_vm_pu`: Initial voltage magnitudes for the power flow calculation.\n\n4. **Large Networks with High PU Transformer (`TrafoHighPuSegmentedNet`)**\n   - This network simulates a transformer with high per-unit values and multiple segments.\n   - It consists of:\n     - Two buses at 10kV.\n     - A transformer connecting the two buses.\n     - Multiple segments with lines, 10kv bus, and distributed generation.\n     - An external grid connected to the first bus.\n   - Parameters:\n     - `vm_pu`: Voltage magnitude at the external grid bus.\n     - `vn_lv_kv`: Low voltage side nominal voltage of the transformer.\n     - `total_p_gen`: Total active power generation distributed across segments.\n     - `total_q_gen`: Total reactive power generation distributed across segments.\n     - `init_vm_pu`: Initial voltage magnitudes for the power flow calculation.\n\n### Data Generation\nThe `net_gen.py` script provides functions to generate multiple instances of these networks with randomized parameters within specified ranges:\n\n- **`sample_net_high_gen_inj_xs(N)`**:\n  - Generates `N` instances of `HighGenInjectionNet` with randomized parameters.\n  - Parameter ranges:\n    - `VM_PU_RANGE = [0.9, 3.0]`\n    - `P_MW_RANGE = [0.0, 1000.0]`\n    - `Q_MVAR_RANGE = [0.0, 0.5]`\n    - `INIT_VM_PU_MIN = 0.9`\n    - `INIT_VM_PU_MAX = 3.0`\n\n- **`sample_net_trafo_high_pu_xs(N)`**:\n  - Generates `N` instances of `TrafoHighPuNet` with randomized parameters.\n  - Parameter ranges:\n    - `VM_PU_RANGE = [0.9, 3.0]`\n    - `P_MW_RANGE = [0.0, 1000.0]`\n    - `Q_MVAR_RANGE = [0.0, 0.5]`\n    - `VN_LV_KV_RANGE = [0.9, 3.0]`\n    - `INIT_VM_PU_MIN = 0.9`\n    - `INIT_VM_PU_MAX = 3.0`\n\n- **`sample_net_high_gen_segmented_xl(N)`**:\n  - Generates `N` instances of `HighGenSegmentedNet` with randomized parameters.\n  - Parameter ranges:\n    - `VM_PU_RANGE = [0.9, 3.0]`\n    - `TOTAL_P_GEN_RANGE = [0.0, 1000.0]`\n    - `TOTAL_Q_GEN_RANGE = [0.0, 0.5]`\n    - `P_MW_RANGE = [0.0, 1000.0]`\n    - `Q_MVAR_RANGE = [0.0, 0.5]`\n    - `INIT_VM_PU_MIN = 0.9`\n    - `INIT_VM_PU_MAX = 3.0`\n\n- **`sample_net_trafo_high_pu_segmented_xl(N)`**:\n  - Generates `N` instances of `TrafoHighPuSegmentedNet` with randomized parameters.\n  - Parameter ranges:\n    - `VM_PU_RANGE = [0.9, 3.0]`\n    - `VN_LV_KV_RANGE = [0.9, 3.0]`\n    - `TOTAL_P_GEN_RANGE = [0.0, 1000.0]`\n    - `TOTAL_Q_GEN_RANGE = [0.0, 0.5]`\n    - `INIT_VM_PU_MIN = 0.9`\n    - `INIT_VM_PU_MAX = 3.0`\n\nThese functions return lists of network instances that can be used for training or analysis purposes.\n\nYou can call these functions and classes like the fllowing:\n```python\nfrom data import HighGenInjectionNet, sample_net_high_gen_inj_xs\n\nnets = sample_net_high_gen_inj_xs(2)\nnets[0].run_power_flow()\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowergridmodel%2Fict-workshop-newton-raphson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowergridmodel%2Fict-workshop-newton-raphson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowergridmodel%2Fict-workshop-newton-raphson/lists"}