Comments (10)
@seadra @ChrisRackauckas I'm sorry,
Actually, matrix PDE is already supported.
Here's an example that runs:
@parameters x y θ
@variables u[1:2,1:2](..)
@derivatives Dxx''~x
@derivatives Dyy''~y
# matrix PDE
eqs = @. [(Dxx(u_(x,y,θ)) + Dyy(u_(x,y,θ))) for u_ in u] ~ -sin(pi*x)*sin(pi*y)*[0 1; 0 1]
# Initial and boundary conditions
bcs = [[u[1](x,0,θ) ~ x u[2](x,0,θ) ~ 2;
u[3](x,0,θ) ~ 3 u[4](x,0,θ) ~ 4]]
# or
# bcs = [@. [u_(x,0,θ) for u_ in u] ~ [x 1; 3 4]]
# Space and time domains
domains = [x ∈ IntervalDomain(0.0,1.0), y ∈ IntervalDomain(0.0,1.0)]
# Discretization
dx = 0.1
discretization = NeuralPDE.PhysicsInformedNN(dx)
# Neural network and optimizer
opt = Flux.ADAM(0.1)
chain = FastChain(FastDense(2,8,Flux.σ),FastDense(8,4))
pde_system = PDESystem(eqs,bcs,domains,[x,y],u)
prob = NeuralPDE.discretize(pde_system,discretization)
alg = NeuralPDE.NNDE(chain,opt,autodiff=false)
phi,res = solve(prob,alg,verbose=true, maxiters=50)
I'll double-check this task again when I move to generalize the parser.
from neuralpde.jl.
What do you want that equation to say? I don't understand the equation.
from neuralpde.jl.
Sorry about the lack of details in the example. u
is supposed to be a 4x4 matrix in the equation, although I couldn't find a way to specify it.
In practice, though, the kind of PDE I'm after is a complex vector equation (like Schrodinger equation with spin) where the Hamiltonian is a position-dependent matrix.
from neuralpde.jl.
@variables u[1:4,1:4]
and
A = sin(pi*x)*sin(pi*y)*[0 1; 0 1]
eq = @. Dxx(u(x,y,θ)) + Dyy(u(x,y,θ)) ~ -A
?
from neuralpde.jl.
Thanks for the response!
I just tried it, but it's giving an error:
MethodError: objects of type Array{Operation,2} are not callable
Use square brackets [] for indexing an Array.
Stacktrace:
[1] _broadcast_getindex_evalf at ./broadcast.jl:648 [inlined]
[2] _broadcast_getindex at ./broadcast.jl:621 [inlined]
[3] _getindex at ./broadcast.jl:645 [inlined]
[4] _broadcast_getindex at ./broadcast.jl:620 [inlined]
[5] _getindex at ./broadcast.jl:644 [inlined]
[6] _broadcast_getindex at ./broadcast.jl:620 [inlined]
[7] _getindex at ./broadcast.jl:644 [inlined]
[8] _broadcast_getindex at ./broadcast.jl:620 [inlined]
[9] getindex at ./broadcast.jl:575 [inlined]
[10] copy at ./broadcast.jl:876 [inlined]
[11] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2},Nothing,typeof(~),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,typeof(+),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,Base.var"#62#63"{Differential,Differential},Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,Array{Operation,2},Tuple{Operation,Operation,Operation}}}},Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,Base.var"#62#63"{Differential,Differential},Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,Array{Operation,2},Tuple{Operation,Operation,Operation}}}}}},Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2},Nothing,typeof(-),Tuple{Array{Operation,2}}}}}) at ./broadcast.jl:837
[12] top-level scope at In[9]:9
from neuralpde.jl.
I don't think support for systems has been tagged yet, but @KirillZubov you might want to test on this one.
from neuralpde.jl.
Hi @seadra, the matrix PDEs form isn't supported for PINNs yet. But it will be implemented.
from neuralpde.jl.
A matrix is just a system when you vec
it, so once systems of PDEs are done this should be done.
from neuralpde.jl.
@ChrisRackauckas can we test/run the "NeuralPDE.jl" examples in Binder Julia?
from neuralpde.jl.
That should be possible.
from neuralpde.jl.
Related Issues (20)
- Parameter Estimation formulation in PINNs HOT 5
- Documentation for BayesianPINN and ahmc_bayesian_pinn_pde
- Encountering Precompilation Error Messages When Adding NeuralPDE Package in Julia HOT 3
- Distance functions as a description of complex geometries HOT 1
- Bump CUDA Compat HOT 1
- How can I solve complex-valued ordinary differential equations (ODEs) using neural networks, given limitations with complex data types in libraries like Lux? HOT 7
- Can't get the @named pde_system to work with a ode system HOT 4
- Add support for equations with complex numbers HOT 20
- Neural Adapter Documentation Example Not Working HOT 6
- DGM Tutorial fails HOT 2
- KeyError when solving Parameter Identification problem using NeuralPDE.jl HOT 9
- Linear parabolic example throws an error on new julia install HOT 2
- NeuralPDE slows when using old weights and biases on a new but related ode HOT 3
- NeuralPDE with LuxAMDGPU, Optimize.solve throws error
- GPU Compatibility Issue: Compilation Error with Complex-Valued Data in LuxCUDA Broadcasting Kernel HOT 8
- Tutorial: imposing constraint on PINN solution of Fokker Planck fails HOT 5
- The trial solutions to additional_loss function are different depending on parameters
- API PINO PDE HOT 5
- How to solve SDEs with NeuralPDE?
- Vector output for PINO ODE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuralpde.jl.