KirillZubov on gpu_pinns
gpu pinns (compare)
KirillZubov on gpu_pinns
nargs
search on DiffEqBase gave me no results π€)
A\b
works, but I am benchmarking different methods.
A\b
does something perhaps overly smart and switches the solver depending on the dimensions i believe
A
matrix comprises derivative operators, so I'm also looking at DiffEqOperators.
SecondOrderODEProblem
still supported? I had a hard time understand what inputs the dynamics function should take. Unfortunately reading https://github.com/SciML/DiffEqBase.jl/blob/864c379ead274243acdd965bd8942d1da1deb3bb/test/problem_creation_tests.jl#L51 didn't shed a lot of light for me. I'm not sure what the relationship between u
and v
are, and the docstring args from the SecondOrderODEProblem
constructor seems flipped compared to its implementation. Thanks for any information!
[slack] <jonas.isensee> Thanks you, that seems to work.
Not sure that is much better for my particular usecase though.
I want to work with the matrix directly andu.x[2]
is probably not much better than`@view u[:,2:4]`
at the cost of introducing another abstraction layer.
(relevant since this is for teaching...)
[slack] <David Millard> Hi, I'm sure I'm misusing VectorContinuousCallback
, but I can't seem to figure out why. I effectively have a slightly fancier version of the bouncing ball example, where the bottom points of a mesh make inelastic contact with a floor plane at z = 0.
The multi-wall bouncing ball works fine for me. However, I can't seem to convince the affect!
function to trigger in my program. Relevant bits:
```z(u) = view(u, 3, :, 1)
dz(u) = view(u, 3, :, 2)
floor_cond(out, u, t, int) = out .= ifelse.(z(u) .> 0, z(u), 0)
function floor_affect!(int, idx)
z(int.u)[idx] = 0
dz(int.u)[idx] = 0
end
floor_cb = VectorContinuousCallback(floor_cond, floor_affect!, nothing, size(state, 2); rootfind=false)
prob = ODEProblem{true}(elastic_dynamics!, state, (0, 1 / 60), params)
sol = solve(prob, callback=floor_cb; dt=1e-4)``
Setting
zand
dzto 0 yields the behavior I want in my own dinky homemade Euler solver, where I just check the z-coord and apply the affect with an
if` block.
Secondary meta question: is this the right venue for questions like this?
Hi, I'm new to Julia and the Neural PDE library, and I was wondering if there if is a way to implement the following idea in the Physics Informed Neural Network.
Take for example the 1D Poisson eq. $u_{xx} = f$ with $u(0) = u(1) = 0$. This could be solved by taking the neural network output (call it $Ε©$) and multiplying it by $x(x-1)$. Since this polynomial is zero on the boundary, the boundary conditions are automatically enforced, and the PDE is enforced with $u = Ε©*x*(x-1)$.
I tried doing something like this by
@variables u(..)
@parameters x
@derivatives Uxx''~x
eq = Uxx(u(x)*x*(x-1.0) )~ 1
and then following (and modifying dimensions where appropriate) the rest of the tutorial at https://github.com/SciML/NeuralPDE.jl
When I do this, I get UndefVarError: *_d not defined
. Everything runs as expected when I useeq = Uxx(u(x) )~ 1
, so maybe multiplication between parameters and variables is undefined? Is there a way I can implement this?
Any help would be appreciated.