Closed dapias closed 3 years ago
For what is worth I just tested this and it worked for me. Try ] up to make sure you get the latest version of the packages.
Thank you. I apologise. It works with the latest version of the packages in Julia1.6.
No problem!
Soon v1.6 will be the new LTS for Julia which will make this simpler.
Could you please check the next part of the example? I have got problems with the command pde_system
. After this:
using NeuralPDE, Flux, ModelingToolkit, GalacticOptim, Optim, DiffEqFlux, DomainSets
import ModelingToolkit: Interval, infimum, supremum
@parameters t
@variables i(..)
Di = Differential(t)
Ii = Integral(t in DomainSets.ClosedInterval(0, t))
eq = Di(i(t)) + 2*i(t) + 5*Ii(i(t)) ~ 1
bcs = [i(0.) ~ 0.0]
domains = [t ∈ Interval(0.0,2.0)]
chain = Chain(Dense(1,15,Flux.σ),Dense(15,1))
initθ = Float64.(DiffEqFlux.initial_params(chain))
strategy_ = GridTraining(0.05)
discretization = PhysicsInformedNN(chain,
strategy_;
init_params = nothing,
phi = nothing,
derivative = nothing)
pde_system = PDESystem(eq,bcs,domains,[t],[i(t)])
I got:
ERROR: UndefKeywordError: keyword argument name not assigned Stacktrace: [1] PDESystem(eqs::Equation, bcs::Vector{Equation}, domain::Vector{Symbolics.VarDomainPairing}, ivs::Vector{Num}, dvs::Vector{Num}, ps::SciMLBase.NullParameters) (repeats 2 times) @ ModelingToolkit ~/.julia/packages/ModelingToolkit/iEq0Q/src/systems/pde/pdesystem.jl:70 [2] top-level scope @ REPL[31]:1
That one is our bad
Do @named pde_system = PDESystem(eq,bcs,domains,[t],[i(t)])
and it should work
@killah-t-cell thank you! I was able to run the whole example :)
Hello. I am testing the code here and got an error with the first couple of lines
This rises: