Giter VIP home page Giter VIP logo

pinns-and-ipinns-pytorch's Introduction

PINNS and iPINNS in Pytorch

This repository hosts my PyTorch implementations of PINN (Physics-Informed Neural Network) and iPINN (inverse Physics-Informed Neural Network) from the tutorial https://towardsdatascience.com/inverse-physics-informed-neural-net-3b636efeb37e

The original implementations were crafted using TensorFlow and can be accessed at https://github.com/jmorrow1000/PINN-iPINN

Python 3.10.12
PyTorch Version: 2.1.0+cu121
NumPy Version: 1.25.2
Matplotlib Version: 3.7.1

The current implementation concentrates on a PINN and iPINN for the second-order differential equation governing an RLC circuit:

$$ L \frac{d^2 i}{dt^2} + R \frac{di}{dt} + \frac{1}{C} i = 0. $$

Here, $R$, $L$, and $C$ denote the circuit's resistance, inductance, and capacitance, respectively. The variable $i$ represents the current in the circuit, while $t$ signifies time.

PINN results

Below are the results from training a PINN on three test cases: under-damped, critically-damped, and over-damped. For definitions of each scenario, please refer to the original tutorial. Each plot presents a comparison between the analytical solution and the response output from the trained PINN.

image1 image2 image3

iPINN results

Below are the results of applying an iPINN to determine three unknown parameters—R, L, and C—in three different scenarios: under-damped, critically-damped, and over-damped. The tables juxtapose the parameters used to generate the test responses with those inferred by the iPINN. The plots provide a comparison of the analytical solutions and the predictions made by the trained iPINN.

Under-damped scenario:

Circuit Parameter Generating Value iPINN Value
R (ohms) 1.20 1.201
L (henries) 1.50 1.499
C (farads) 0.30 0.300
image

Critically-damped scenario:

Circuit Parameter Generating Value iPINN Value
R (ohms) 4.47 4.472
L (henries) 1.50 1.503
C (farads) 0.30 0.299
image

Over-damped scenario:

Circuit Parameter Generating Value iPINN Value
R (ohms) 6.00 6.005
L (henries) 1.50 1.500
C (farads) 0.30 0.299
image

@software{wojtak_pinn_ipinn_2024,
title = {PINN and iPINN for RLC Circuit Equation in Pytorch},
author = {Weronika Wojtak},
month = feb,
year = 2024,
version = {1.0},
publisher = {GitHub},
repository = {https://github.com/w-wojtak/PINNs-and-iPINNs-Pytorch},
}

pinns-and-ipinns-pytorch's People

Contributors

w-wojtak avatar

Stargazers

 avatar  avatar Giovanni Pollo avatar

Watchers

 avatar

Forkers

jmorrow1000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.