RasmahRasmah

Physics-Informed Neural Network Topology Optimization

println("Julia ", VERSION)
Julia 1.12.6

Overview

A physics-informed neural network (PINN) (Raissi, Perdikaris & Karniadakis 2019) represents the state u(x) of a PDE as a neural network trained to satisfy the governing equation directly, with no mesh. PINN-based topology optimization (Zeighami et al. 2021) uses that network state inside the compliance loop, so the whole design-to-simulate pipeline is differentiable end-to-end.

Here pinn_poisson_1d solves the bar −d/dx(E(x) du/dx) = q, u(0) = u(1) = 0, with hard boundary conditions u(x) = x(1−x)·N(x):

using Rasmah

net, θ = pinn_poisson_1d(_ -> 1.0, _ -> 1.0, 0.0, 1.0; hidden = [16, 16], epochs = 1000, lr = 2e-3, seed = 0)

# the trained field is u(x) = x(1−x)·N(x); the analytic solution is u = x(1−x)/2
u(x) = x * (1 - x) * apply(net, θ, [x]; act = tanh)[1]
println("u(0.5) = ", round(u(0.5); digits = 4), "   (analytic 0.125)")
u(0.5) = 0.1251   (analytic 0.125)

Verification

For a constant E and load q the bar has the closed form u = qx(1−x)/(2E); the PINN state converges tightly to it:

err = maximum(abs(u(x) - 1.0 * x * (1 - x) / 2) for x in 0.0:0.05:1.0)
println("max field error = ", round(err; sigdigits = 3))
max field error = 0.000153

Next steps