[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,61 +2,186 @@
|
||||
id: wiki-2026-0508-partial-differential-equations
|
||||
title: Partial Differential Equations
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [MATH-PDE-001]
|
||||
aliases: [PDE, Distributed Parameter Systems]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 1.0
|
||||
tags: [math, calculus, pde, Physics-informed-ml, scientific-computing, fluid-dynamics]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [pde, numerical-methods, scientific-computing, pinn]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-26
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: Python
|
||||
framework: FEniCSx/JAX/PyTorch
|
||||
---
|
||||
|
||||
# Partial Differential Equations (PDE, 편미분 방정식)
|
||||
# Partial Differential Equations
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "세상의 모든 복잡한 변화는 시간과 공간이라는 여러 변수의 얽힘 속에 있으며, 이를 편미분이라는 돋보기로 들여다볼 때 비로소 물리적 질서가 드러난다" — 독립 변수가 둘 이상인 함수와 그 도함수들 사이의 관계를 나타내는 방정식으로, 물리적 세계의 연속적인 변화를 설명하는 가장 강력한 수학적 언어.
|
||||
## 매 한 줄
|
||||
> **"매 multivariable function 의 partial derivative relations"**. 매 PDE는 매 fluid (Navier-Stokes), heat, wave, elasticity, EM (Maxwell), QM (Schrödinger), finance (Black-Scholes) 의 universal language, 매 2026 numerical solving은 매 FDM/FEM/FVM/spectral + PINN/Neural Operator (FNO, DeepONet) 의 hybrid 시대.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **추출된 패턴:** "Multi-variable Dynamics and Constraint Satisfaction" — 열 전도(Heat), 파동(Wave), 유체 흐름(Navier-Stokes) 등 공간상의 위치와 시간의 흐름에 따라 변하는 물리 현상을 수식화하고, 이를 수치 해석이나 신경망을 통해 해결하여 미래 상태를 예측하는 패턴.
|
||||
- **AI와의 접점:**
|
||||
- **PINNs (Physics-informed Neural Networks):** 신경망의 손실 함수에 PDE 식을 직접 포함시켜, 데이터뿐만 아니라 물리 법칙까지 준수하도록 학습.
|
||||
- **Scientific AI:** 기상 예측, 신소재 설계, 유체 역학 시뮬레이션 등 정밀한 과학적 추론이 필요한 분야의 핵심 엔진.
|
||||
- **의의:** 데이터가 부족한 환경에서도 물리적 법칙(상식)을 바탕으로 정확한 추론을 가능케 하며, '블랙박스 AI'를 '법칙 기반 AI'로 진화시키는 가교 역할.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 엄청난 연산량이 필요한 수치 해석(Finite Element Method 등)에만 의존하던 방식에서, 이제는 신경망이 PDE의 해를 직접 근사하여 수만 배 빠른 속도로 시뮬레이션을 수행하는 'AI 대리 모델(Surrogate Model)' 방식으로 패러다임이 시프트됨.
|
||||
- **정책 변화:** Antigravity 프로젝트는 향후 Skybound의 기상 효과 시뮬레이션이나 물리 기반 에이전트 행동 최적화 시, PDE 기반의 PINNs 아키텍처를 도입하여 시각적 리얼리티와 물리적 개연성을 동시에 확보할 계획임.
|
||||
### 매 분류 (2nd order linear)
|
||||
- B² - 4AC 로:
|
||||
- **Elliptic** (<0): Laplace ∇²u=0, Poisson — equilibrium.
|
||||
- **Parabolic** (=0): heat uₜ = α∇²u — diffusion.
|
||||
- **Hyperbolic** (>0): wave uₜₜ = c²∇²u — propagation.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Optimal-Control-Theory|Optimal-Control-Theory]], Fluid-Dynamics, [[Deep-Learning|Deep-Learning]]-Foundations, Scientific-Computing-in-AI
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Partial-Differential-Equations.md
|
||||
### 매 well-posed (Hadamard)
|
||||
- Existence, uniqueness, continuous dependence on data.
|
||||
- Boundary conditions: Dirichlet, Neumann, Robin.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 numerical methods
|
||||
- **FDM**: structured grid, easy, low geometry flexibility.
|
||||
- **FEM**: weak form, complex geometry, h/p refinement.
|
||||
- **FVM**: conservation laws (CFD).
|
||||
- **Spectral**: smooth solutions, exponential convergence.
|
||||
- **PINN (2026)**: NN minimizing PDE residual, mesh-free, inverse problems.
|
||||
- **Neural Operator**: FNO/DeepONet learn solution operator.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용
|
||||
1. CFD (aerospace, weather).
|
||||
2. Heat transfer / thermal analysis.
|
||||
3. Structural mechanics.
|
||||
4. EM simulation (CST, COMSOL).
|
||||
5. Option pricing (Black-Scholes PDE).
|
||||
6. Diffusion models (LLM/image gen with score-PDE).
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
### 1D Heat Equation — explicit FDM
|
||||
```python
|
||||
import numpy as np
|
||||
def heat_explicit(u0, alpha, dx, dt, T):
|
||||
r = alpha*dt/dx**2
|
||||
assert r <= 0.5, "CFL violated"
|
||||
u = u0.copy(); steps = int(T/dt)
|
||||
for _ in range(steps):
|
||||
u[1:-1] = u[1:-1] + r*(u[2:] - 2*u[1:-1] + u[:-2])
|
||||
return u
|
||||
```
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
### Crank-Nicolson (implicit, 2nd order)
|
||||
```python
|
||||
from scipy.sparse import diags
|
||||
from scipy.sparse.linalg import spsolve
|
||||
def crank_nicolson(u0, alpha, dx, dt, T):
|
||||
n = len(u0); r = alpha*dt/(2*dx**2)
|
||||
A = diags([-r, 1+2*r, -r], [-1,0,1], shape=(n-2, n-2)).tocsc()
|
||||
B = diags([ r, 1-2*r, r], [-1,0,1], shape=(n-2, n-2))
|
||||
u = u0.copy()
|
||||
for _ in range(int(T/dt)):
|
||||
u[1:-1] = spsolve(A, B @ u[1:-1])
|
||||
return u
|
||||
```
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
### 2D Poisson via FEM (FEniCSx)
|
||||
```python
|
||||
from dolfinx import mesh, fem
|
||||
from ufl import TrialFunction, TestFunction, dx, grad, inner
|
||||
import numpy as np
|
||||
domain = mesh.create_unit_square(MPI.COMM_WORLD, 64, 64)
|
||||
V = fem.FunctionSpace(domain, ("Lagrange", 1))
|
||||
u, v = TrialFunction(V), TestFunction(V)
|
||||
f = fem.Constant(domain, 1.0)
|
||||
a = inner(grad(u), grad(v))*dx
|
||||
L = f*v*dx
|
||||
bc = fem.dirichletbc(0.0, ..., V)
|
||||
problem = fem.petsc.LinearProblem(a, L, bcs=[bc])
|
||||
uh = problem.solve()
|
||||
```
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
### 1D Wave — leapfrog
|
||||
```python
|
||||
def wave_leapfrog(u0, v0, c, dx, dt, T):
|
||||
r = c*dt/dx
|
||||
assert r <= 1, "CFL"
|
||||
u_prev = u0.copy()
|
||||
u = u0 + dt*v0 # half-step init
|
||||
steps = int(T/dt)
|
||||
for _ in range(steps):
|
||||
u_next = 2*u[1:-1] - u_prev[1:-1] + r**2*(u[2:] - 2*u[1:-1] + u[:-2])
|
||||
u_prev[1:-1] = u[1:-1]; u[1:-1] = u_next
|
||||
return u
|
||||
```
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
### PINN for Burgers' equation
|
||||
```python
|
||||
import torch, torch.nn as nn
|
||||
class PINN(nn.Module):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.net = nn.Sequential(
|
||||
nn.Linear(2,64), nn.Tanh(), nn.Linear(64,64), nn.Tanh(),
|
||||
nn.Linear(64,64), nn.Tanh(), nn.Linear(64,1))
|
||||
def forward(self, xt): return self.net(xt)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
def pde_residual(model, xt, nu=0.01/np.pi):
|
||||
xt.requires_grad_(True)
|
||||
u = model(xt)
|
||||
grads = torch.autograd.grad(u, xt, torch.ones_like(u), create_graph=True)[0]
|
||||
u_x, u_t = grads[:,0:1], grads[:,1:2]
|
||||
u_xx = torch.autograd.grad(u_x, xt, torch.ones_like(u_x), create_graph=True)[0][:,0:1]
|
||||
return u_t + u*u_x - nu*u_xx
|
||||
# Loss = MSE(pde_residual) + MSE(IC) + MSE(BC); Adam optimize.
|
||||
```
|
||||
|
||||
### Fourier Neural Operator (FNO, 2026)
|
||||
```python
|
||||
import torch, torch.nn as nn
|
||||
class SpectralConv1d(nn.Module):
|
||||
def __init__(self, in_ch, out_ch, modes):
|
||||
super().__init__()
|
||||
self.modes = modes
|
||||
self.weight = nn.Parameter(torch.randn(in_ch, out_ch, modes, dtype=torch.cfloat)*0.02)
|
||||
def forward(self, x): # x: (B, C, N)
|
||||
N = x.size(-1)
|
||||
x_ft = torch.fft.rfft(x)
|
||||
out_ft = torch.zeros(x.size(0), self.weight.size(1), N//2+1, dtype=torch.cfloat, device=x.device)
|
||||
out_ft[..., :self.modes] = torch.einsum("bcm,com->bom", x_ft[..., :self.modes], self.weight)
|
||||
return torch.fft.irfft(out_ft, n=N)
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Simple geometry, structured | FDM |
|
||||
| Complex geometry / multi-physics | FEM |
|
||||
| Conservation laws, shocks | FVM (CFD) |
|
||||
| Smooth, periodic | Spectral / pseudo-spectral |
|
||||
| Inverse / sparse data | PINN |
|
||||
| Many similar PDEs (parametric) | Neural Operator (FNO/DeepONet) |
|
||||
| Stochastic / high-dim | Deep BSDE / Monte Carlo |
|
||||
|
||||
**기본값**: classical solving은 FEM (FEniCSx) or FVM (OpenFOAM); ML-side는 FNO; inverse problem은 PINN.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Mathematics]] · [[Numerical-Methods]] · [[Calculus]]
|
||||
- 변형: [[Heat-Equation]] · [[Wave-Equation]] · [[Navier-Stokes]] · [[Schrodinger-Equation]]
|
||||
- 응용: [[CFD]] · [[Structural-Mechanics]] · [[Option-Pricing]]
|
||||
- Adjacent: [[PINN]] · [[Neural-Operator]] · [[Diffusion-Models]] · [[Finite-Element-Method]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: PDE classification 설명, BC formulation help, weak form derivation, PINN architecture suggestion.
|
||||
**언제 X**: actual numerical solving (FEniCSx/JAX/OpenFOAM 매 use).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **CFL violation**: explicit scheme에 dt 매 too large → blow up.
|
||||
- **PINN as universal**: PINN 매 hard problems 에 매 종종 fail (high-freq/turbulent) — 매 classical FEM 매 첫 baseline.
|
||||
- **No mesh convergence study**: 매 must show error vs h/p refinement.
|
||||
- **Wrong BC**: Neumann ↔ Dirichlet mistake → 매 entire solution wrong.
|
||||
- **Ignoring stability**: implicit ≠ unconditionally accurate (just stable).
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Strikwerda "Finite Difference Schemes", Brenner & Scott "FEM", Karniadakis et al PINN review).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — classical methods + PINN/FNO (2026) |
|
||||
|
||||
Reference in New Issue
Block a user