graphify
GRGraphify-Labs/graphify156k2,564 new stars in the last 7 days
Define PDEs, ODEs, boundary conditions, and custom equations for PINA physics-driven problems. Covers the equation zoo, custom equation functions, and inverse problem equation signatures.
Important
Read RULES.md before using this skill — it applies to all skills. This is a sub-skill of create-problem. Load the entry-point skill first.
Use this skill when the problem is physics-driven and you need to define the governing equations and boundary conditions.
What physical equations apply?
First check if the equation is available in the built-in zoo:
| Zoo class | Equation |
|---|---|
FixedValue(value) | u - v = 0 (Dirichlet BC) |
FixedGradient(value) | ∂u/∂n - v = 0 (Neumann BC) |
FixedFlux(value) | div(u) - v = 0 (flux BC) |
FixedLaplacian(value) | Δu - v = 0 (Laplacian BC) |
PoissonEquation(forcing_f) | Δu = f |
BurgersEquation(nu) | u_t + u u_x = ν u_xx |
AdvectionEquation(beta) | u_t + β·∇u = 0 |
AllenCahnEquation(ε, α) | u_t = ε u_xx + α (u - u³) |
DiffusionReactionEquation(λ) | u_t = λ Δu + f |
HelmholtzEquation(k) | Δu + k² u = f |
AcousticWaveEquation(c) | u_tt = c² Δu |
If the equation matches one of these, use it directly.
If the equation is not in the zoo:
.opencode/skills/define-equations/famous_odes_pdes.json,
if not present search the web for the equation form, common PINN implementation, and known
boundary/initial conditions.I found this equation:
<formulation>. Should I use this or would you like to provide your own?
What boundary conditions apply? (Dirichlet, Neumann, Robin, periodic, etc.)
A well-posed PDE problem needs both the PDE and its boundary/initial conditions. Common types:
FixedValue(value) — imposes u = value on the boundaryFixedGradient(value) — imposes ∂u/∂n = valueFixedFlux(value) — imposes div(u) = valueFixedLaplacian(value) — imposes Δu = valueFor zoo boundary conditions, use components and d parameters when the
problem has multiple output variables:
FixedGradient(0.0, components=["theta"], d=["t"])
Import the required utilities:
from pina.operator import grad
from pina.equation import Equation
def my_pde(input_, output_):
u_x = grad(output_, input_, components=["u"], d=["x"])
u = output_.extract(["u"])
return u_x - u
When the problem is also an InverseProblem, the equation function receives a
third argument params_ (a dict of unknown parameters):
def my_pde_inverse(input_, output_, params_):
f = torch.exp(-2 * (input_["x"] - params_["mu1"])**2)
return laplacian(output_, input_, components=["u"], d=["x"]) - f
Wrap equations in Condition objects. Return to the condition-setup or
create-problem skill for this step.
from pina import Condition
conditions = {
"interior": Condition(domain="D", equation=Equation(my_pde)),
"dirichlet_bc": Condition(domain="boundary", equation=FixedValue(0.0)),
"neumann_bc": Condition(domain="boundary", equation=FixedGradient(0.0)),
"ic": Condition(domain="t0", equation=Equation(initial_cond)),
}
Equation)(input_, output_) for standard, (input_, output_, params_) for inverseLabelTensor with correct components and d parameter namesGRGraphify-Labs/graphify156k2,564 new stars in the last 7 days
PApaperclipai/paperclip119k1,966 new stars in the last 7 days
NEnexu-io/open-design111k1,277 new stars in the last 7 days
HEheygen-com/hyperframes94k4,558 new stars in the last 7 days
BYbytedance/deer-flow86k276 new stars in the last 7 days
BYbytedance/deer-flow86k276 new stars in the last 7 days