ChrisRackauckas on individual
tabbit (compare)
ChrisRackauckas on individual
Allow individualized work-preciβ¦ (compare)
kanav99 on gh-pages
build based on 4cdcd9d (compare)
ChrisRackauckas on master
Typo with Modelingtoolkitize Merge pull request #753 from Glβ¦ (compare)
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.
[slack] <Arjun Narayanan> I am noticing some strange behavior with upwinding. Here is my simple example for the advection equation (taking into account the periodicity mistake I made earlier)
```using OrdinaryDiffEq
using DiffEqOperators
derivative_order = 1
approximation_order = 1
speed = -1.
len = 20
dx = (1.0)/(len-1)
x = collect(range(dx/2,1.0-dx/2,length=len-1))
CFL = 0.5
dt = CFL*dx/abs(speed)
stoptime = 5dt
op = UpwindDifference(derivative_order,approximation_order,dx,len,speed)
bc = PeriodicBC(eltype(x))
exactsoln(x,a,t) = sin.(4pix .- at)
u0 = exactsoln(x,speed,0.0)
du0 = opbcu0
function advection(du,u,p,t)
du .= opbcu0
end
prob = ODEProblem(advection,u0,(0.,stoptime))
soln = solve(prob,Euler(),dt=dt)```