Giter Club home page Giter Club logo

pcnn's Introduction

PCNN

Physics Constrained Neural Networks

LANL public release: LA-UR-23-21008


Cite as:

A. Scheinker and R. Pokharel, Physics Constrained 3D Convolutional Neural Networks for Electrodynamics, APL Machine Learning, 2023


This work presents a physics-constrained neural network (PCNN) approach to solving Maxwell’s equations for the electromagnetic fields of intense relativistic charged particle beams.

We create a 3D convolutional PCNN to map time-varying current and charge densities J(r,t) and ρ(r,t) to vector and scalar potentials A(r,t) and φ(r,t) from which we generate electromagnetic fields according to Maxwell’s equations: B = ∇×A, E = −∇φ −∂A/∂t.

Our PCNNs satisfy hard constraints, such as ∇ · B = 0, by construction. Soft constraints push A and φ towards satisfying the Lorenz gauge.

Included are the code to define and train the 3D convolutional neural networks as well as data sets for testing of the algorithm.

The PCNN setup for hard constrained E and B field generation with a soft Lorenz gauge constraint is shown in the Figure below.

One example of generated E and B fields for a 3D electron bunch of varying charge and current density is shown below.

We look at an (x,y) slice in the middle of the beam, as shown with normalized charge density in the image below.

In the attached code "Check_Divergence" we generate the magnetic field B using a regular CNN without physics constraints, a PINN-based B field, a PCNN-based B field, and the Lorenz PCNN B field. We then calculate the divergence of the B field in each case, and show the (x,y), (x,z), and (y,z) projections of the mid-slice of the beam, as shown below.

Note that all of the divergence values for all fields have problems at the edges of the beam distribution where the beam density is low. This is due to the fact that the code used for this work only generated (E,B) fields at particle locations and therefore at low particle density regions the fields un-physically suddenly vanish and destroy the divergence calculation.

However, in the core of the beam where the charge density is non-zero, it is clear that the PCNN-based B fields have almost zero (within numerical limitations) divergence while both the no physics and the PINN-based fields have non-zero divergence. This is also described in the paper.

One way to see this differnce more cleanly is to use a threshold, to cut off fields at regions of sufficiently low charge density and then plot the divergence only there, as shown in the figure below.

pcnn's People

Contributors

alexscheinker avatar

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.