# Minimal PINN example in Julia that works with current packages?

**URL:** <https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147>\
**Category:** Machine Learning\
**Tags:** pinn\
**Created:** [May 17, 2026, 6:59am UTC](https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147 "2026-05-17T06:59:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [May 17, 2026, 6:59am UTC](https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147/1 "2026-05-17T06:59:54Z")

</div>

Hi, I’m trying to write a simple PINN (e.g., Newton cooling ODE) in Julia. I’ve tried Flux + Zygote but keep hitting issues from recent API changes and slow higher‑order AD. What’s the current recommended stack and a minimal working example that actually runs? Would you go with Flux, Lux, or just use NeuralPDE.jl? Tips on stable AD for second‑order derivatives are also welcome. Thanks!

---

<div class="post-metadata">

**Author:** ![yolhan\_mannes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yolhan_mannes/32/220485_2.png) [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Post date:** [May 17, 2026, 10:50am UTC](https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147/2 "2026-05-17T10:50:02Z")

</div>

Lux + Reactant+ Enzyme is the current way I think. I don’t know if NeuralPDE did the switch yet

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [May 17, 2026, 2:10pm UTC](https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147/3 "2026-05-17T14:10:55Z")

</div>

Is there any public working example for reference?

---

<div class="post-metadata">

**Author:** ![yolhan\_mannes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yolhan_mannes/32/220485_2.png) [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Post date:** [May 17, 2026, 4:02pm UTC](https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147/4 "2026-05-17T16:02:41Z")

</div>

> **[Training a PINN on 2D PDE | Lux.jl Docs](https://lux.csail.mit.edu/dev/tutorials/intermediate/4_PINN2DPDE)**
>
> Documentation for LuxDL Repositories

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 18, 2026, 8:59am UTC](https://discourse.julialang.org/t/minimal-pinn-example-in-julia-that-works-with-current-packages/137147/5 "2026-05-18T08:59:03Z")

</div>

> [@yolhan\_mannes](#):
>
> Lux + Reactant+ Enzyme is the current way I think. I don’t know if NeuralPDE did the switch yet

It hasn’t yet, working on it.
