Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Automated MOL Discretizations #180

Closed
ChrisRackauckas opened this issue Sep 20, 2019 · 2 comments
Closed

Automated MOL Discretizations #180

ChrisRackauckas opened this issue Sep 20, 2019 · 2 comments

Comments

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Sep 20, 2019

This is from SciML/DifferentialEquations.jl#469 . #179 now begins down this path, but it's hardcoded for a specific problem. Now we need to make it actually read the PDE description and build the right MOL discretization.

@xtalax
Copy link
Member

xtalax commented Sep 20, 2019

what type is pdesys.prob? when do we get down to the level of individual operators?

@ChrisRackauckas
Copy link
Member Author

There is no pdesys.prob. pdesys has an abstract description of the system:

using ModelingToolkit, DiffEqOperators, DiffEqBase, LinearAlgebra

# Define some variables
@parameters t x
@variables u(..)
@derivatives Dt'~t
@derivatives Dxx''~x
eq  = Dt(u(t,x)) ~ Dxx(u(t,x))
bcs = [u(0,x) ~ - x * (x-1) * sin(x),
           u(t,0) ~ 0, u(t,1) ~ 0]

domains = [t  IntervalDomain(0.0,1.0),
           x  IntervalDomain(0.0,1.0)]

pdesys = PDESystem(eq,bcs,domains,[t,x],[u])

so that's all symbolic. The next step

discretization = MOLFiniteDifference(0.1)
prob = discretize(pdesys,discretization) # This gives an ODEProblem since it's time-dependent

is supposed to take the symbolic problem description and then concretize it. That's why #179 is just a start: it doesn't do the full parsing so it's not entirely correct. This is all good:

https://github.com/JuliaDiffEq/DiffEqOperators.jl/pull/179/files#diff-ad654af8844dce63fa42ab28e1dde917R8-R14

It looks at the domain information and then uses that to piece together the numerical form as a range. We should make it check the number of domains and use that to find the dimension, but first let's stick to 1+1 dimensional. We need some way to tell MOLFiniteDifference that we want to leave t, the first dimension, undiscretized. That should be an option in the algorithm.

But once it does all of that parsing (correctly), then it goes, oh yeah, the way to solve this is by making an ODE defined by ..., which is

https://github.com/JuliaDiffEq/DiffEqOperators.jl/pull/179/files#diff-ad654af8844dce63fa42ab28e1dde917R15-R21

So here it outputs an ODEProblem for the user to solve. It could output a linear problem, nonlinear problem, etc. depending on whether it's a stationary PDE problem, an Elliptic PDE, a fully implicit discretization, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants