# Issue solving 2D wave equation with ModelingToolkit.jl

**URL:** <https://discourse.julialang.org/t/issue-solving-2d-wave-equation-with-modelingtoolkit-jl/62963>\
**Category:** Modelling & Simulations\
**Tags:** question, diffeq\
**Created:** [June 15, 2021, 6:05pm UTC](https://discourse.julialang.org/t/issue-solving-2d-wave-equation-with-modelingtoolkit-jl/62963 "2021-06-15T18:05:00Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 15, 2021, 9:43pm UTC](https://discourse.julialang.org/t/issue-solving-2d-wave-equation-with-modelingtoolkit-jl/62963/10 "2021-06-15T21:43:43Z")

</div>

> [@apattyn](#):
>
> The NeuralODE.jl example looks like the initial waveform just oscillates between ~0.2 and ~-0.2 without ever propagating outwards. Whereas the matlab wave solver shows the initial waveform moving to the boundaries where it is ultimately absorbed my the perfectly-matched-layer (since that toolbox is using a spectral method to solve the wave equation).
> 
> The question I suppose would be am I missing something? e.g. I defined the wave equation incorrectly. Or is ModelingToolkit.jl/ NeuralODE.jl giving an incorrect solution for the 2D wave equation?

It looks like it’s the right solution to 2 digits. Plot the slides as an animation if you’re not sure.

> [@apattyn](#):
>
> ```julia
> MOLFiniteDifference([x=>dx],t)
> 
> ```

The documentation on this says it’s not complete.

> [Note: This uses a currently unreleased interface that is still a work in progress. Use at your own risk!](http://diffeqoperators.sciml.ai/dev/symbolic_tutorials/mol_heat/#Note:-This-uses-a-currently-unreleased-interface-that-is-still-a-work-in-progress.-Use-at-your-own-risk!)

Specifically, upwinding has not merged yet:

> <https://github.com/SciML/DiffEqOperators.jl/pull/390>

So yes, it’s as incorrect as the documentation page says it will be right now. We will remove that note when it’s released, but for right now, I mean, the docs said it’s not fully working yet 😅.

(Specifically, as of today, arbitrary even derivatives work fine, it’s the odd ones that need that to merge)

But anyways, @luraess mentioned, if you have a linear PDE like this then the most efficient thing to do would be to semi-discretize it with ParallelStencil.jl and then solve the ODEs using whichever method (likely one of the SSP integrators like [https://diffeq.sciml.ai/stable/solvers/ode\_solve/#Explicit-Strong-Stability-Preserving-Runge-Kutta-Methods-for-Hyperbolic-PDEs-(Conservation-Laws)](https://diffeq.sciml.ai/stable/solvers/ode_solve/#Explicit-Strong-Stability-Preserving-Runge-Kutta-Methods-for-Hyperbolic-PDEs-(Conservation-Laws))). The coming DiffEqOperators interface is mostly focused on nonlinear and it’s not complete right now.

---

_[View the full topic](https://discourse.julialang.org/t/issue-solving-2d-wave-equation-with-modelingtoolkit-jl/62963)._
