MethodOfLines.jl icon indicating copy to clipboard operation
MethodOfLines.jl copied to clipboard

how to get the spatial discretization? + solution at spatial boundary not included right?

Open SimonEnsemble opened this issue 3 years ago • 5 comments

regarding the heat eqn examples:

  • can we get the spatial discretization from MOLFiniteDifference somehow instead of xs = 0:Δx:ℓ each time? to warrant this I do:
	Nₓ = length(prob.u0) + 2
	@assert (length(0:Δx:ℓ) == Nₓ)
  • [think this should be in the docs or explained on this page] am I right that the solution to the PDE on the points on the spatial boundary are not included in the solution (regardless of the boundary condition)? right now I manually infer these so I can do an integration over the spatial domain.

THANK YOU for this package.

SimonEnsemble avatar Nov 18 '21 00:11 SimonEnsemble

sol[u] should do it. I think it might be broken until a few packages update though? @YingboMa

ChrisRackauckas avatar Nov 20 '21 12:11 ChrisRackauckas

can we get the spatial discretization from MOLFiniteDifference somehow instead of xs = 0:Δx:ℓ each time?

Would be great to have sol.x in the same way as ODE solutions have sol.t. This means the prob that gets returned from discretize needs to save what mesh was used, then pass it to the solution. What's the best way of going about this? Could we make a new struct DiscretizedPDESystem which subtypes ODESystem and saves the mesh?

valentinsulzer avatar Nov 29 '21 15:11 valentinsulzer

@YingboMa would it be a bad idea to add array symbolic expressions x ~ 0:Δx:ℓ as observed variables so that sol[x] works?

ChrisRackauckas avatar Nov 29 '21 20:11 ChrisRackauckas

@YingboMa would it be a bad idea to add array symbolic expressions x ~ 0:Δx:ℓ as observed variables so that sol[x] works?

@YingboMa is this a bad idea?

xtalax avatar Mar 14 '22 22:03 xtalax

MTK doesn't really support array variables right now, and I think we should be careful on designing it.

YingboMa avatar Mar 15 '22 14:03 YingboMa