# Spatial bounds of integration of a PDE using DifferentialEquations

**URL:** <https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241>\
**Category:** Modelling & Simulations\
**Created:** [December 6, 2023, 11:32pm UTC](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241 "2023-12-06T23:32:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alberto\_Roman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alberto_roman/32/50670_2.png) [@Alberto\_Roman](https://discourse.julialang.org/u/Alberto_Roman)\
**Post date:** [December 6, 2023, 11:32pm UTC](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241/1 "2023-12-06T23:32:15Z")

</div>

Hi there,  
I am solving a PDE over a large domain discretizing with finite difference the RHS and using DifferentialEquations.jl to integrate the ODE system in time. Is there anyway in which I can limit the integration to only nodes in the grid comprised in a certain range. I would basically limit the integration in time to only part of my spatial domain, say comprised between indices l,m (1-d case) or (l,m,n,o) for the 2d case.  
This indices might change with times and are successfully computed through callback functions. However, I don’t know how to tell the solver to limit integration only to this part of the spatial domain. Any ideas? Thanks!

---

<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:** [December 7, 2023, 4:50am UTC](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241/2 "2023-12-07T04:50:34Z")

</div>

Just make the ODE the interior

---

<div class="post-metadata">

**Author:** ![Alberto\_Roman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alberto_roman/32/50670_2.png) [@Alberto\_Roman](https://discourse.julialang.org/u/Alberto_Roman)\
**Post date:** [December 7, 2023, 4:16pm UTC](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241/3 "2023-12-07T16:16:02Z")

</div>

Thanks for the answer! To be sure I understand, you are suggesting to redefine the ODEproblem with only the interior points?

---

<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:** [December 7, 2023, 5:21pm UTC](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241/4 "2023-12-07T17:21:31Z")

</div>

Yes, that’s generally the easiest way. ModelingToolkit.jl and MethodOfLines.jl do this automatically, but if you’re writing the code by hand then you should do this too.
