# \#methodoflines

**URL:** https://discourse.julialang.org/tag/methodoflines/1407.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [\[ANN\] MethodOfLines v1: Symbolic Arrays =\> Massive Compile Speedups](https://discourse.julialang.org/t/ann-methodoflines-v1-symbolic-arrays-massive-compile-speedups/138974)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 5\
**Last updated:** [August 24, 2026, 4:50pm UTC](https://discourse.julialang.org/t/ann-methodoflines-v1-symbolic-arrays-massive-compile-speedups/138974 "2026-08-24T16:50:34Z")

</div>

MethodOfLines.jl v1.0 changes all discretizations to using symbolic arrays. If they lower to code using DAEProblem the array structure is kept intact, meaning no more scalarization and massive compile time speedups. Tim…

---

## [Boundary Condition Error in MethodOfLines](https://discourse.julialang.org/t/boundary-condition-error-in-methodoflines/137819)

<div class="topic-metadata">

**Author:** [@ducksoverip](https://discourse.julialang.org/u/ducksoverip)\
**Replies:** 2\
**Last updated:** [June 29, 2026, 12:53pm UTC](https://discourse.julialang.org/t/boundary-condition-error-in-methodoflines/137819 "2026-06-29T12:53:59Z")

</div>

I’m trying to use MethodOfLines to solve the time-independent Schrodinger equation for hydrogen, as a prelude to more complicated systems. The equation is as follows: \\nabla^2 \\psi(\\vec{r}) - \\frac{1}{r}\\psi(\\vec{r}) =…

---

## [\[GSoC '26\] The Illusion of Uniformity: Non-Uniform Grids & Zero-Overhead Dispatch in MOL.jl](https://discourse.julialang.org/t/gsoc-26-the-illusion-of-uniformity-non-uniform-grids-zero-overhead-dispatch-in-mol-jl/136639)

<div class="topic-metadata">

**Author:** [@Utku\_Yilmaz](https://discourse.julialang.org/u/Utku_Yilmaz)\
**Replies:** 0\
**Last updated:** [April 9, 2026, 10:00am UTC](https://discourse.julialang.org/t/gsoc-26-the-illusion-of-uniformity-non-uniform-grids-zero-overhead-dispatch-in-mol-jl/136639 "2026-04-09T10:00:18Z")

</div>

Hi everyone, As part of my GSoC 2026 prep for MethodOfLines.jl, I just published a short devlog on bringing non-uniform grid support to high-order schemes like WENO. My post, “The Illusion of Uniformity,” outlines the a…

---

## [Solving system of spatial Ordinary Differential Equations](https://discourse.julialang.org/t/solving-system-of-spatial-ordinary-differential-equations/135007)

<div class="topic-metadata">

**Author:** [@federicoangioni](https://discourse.julialang.org/u/federicoangioni)\
**Replies:** 1\
**Last updated:** [January 21, 2026, 4:26am UTC](https://discourse.julialang.org/t/solving-system-of-spatial-ordinary-differential-equations/135007 "2026-01-21T04:26:33Z")

</div>

Hello all, I am Federico, and an undergraduate student approaching Julia for the first time as a part of my studies in computational science. I am currently struggling with solving a system of coupled Ordinary Different…

---

## [2D stationary diffusion problem & (?) MethodOfLines](https://discourse.julialang.org/t/2d-stationary-diffusion-problem-methodoflines/118963)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 12\
**Last updated:** [December 24, 2025, 6:23am UTC](https://discourse.julialang.org/t/2d-stationary-diffusion-problem-methodoflines/118963 "2025-12-24T06:23:02Z")

</div>

I’d like to model a mass exchanger which can be represented as diffusion in a fluid flow with given stationary flow field and given coordinate-dependent diffusion coefficient. 2D, rectangular domain, rectangular grid, st…

---

## [Method Error when using Method of Lines to solve PDEs](https://discourse.julialang.org/t/method-error-when-using-method-of-lines-to-solve-pdes/132951)

<div class="topic-metadata">

**Author:** [@gst1017](https://discourse.julialang.org/u/gst1017)\
**Replies:** 3\
**Last updated:** [October 24, 2025, 3:52pm UTC](https://discourse.julialang.org/t/method-error-when-using-method-of-lines-to-solve-pdes/132951 "2025-10-24T15:52:53Z")

</div>

Hello all! I’m new to Julia and am trying to use the Method of Lines and MTK packages to solve a system of PDEs. I am running into repeated method errors, and the stacktrace keeps pointing to a line from Macro Expanded c…

---

## [Discretization of semi-coupled wave and diffusion equations fails for step size of pi/(25n) using MethodOfLines.jl](https://discourse.julialang.org/t/discretization-of-semi-coupled-wave-and-diffusion-equations-fails-for-step-size-of-pi-25n-using-methodoflines-jl/106091)

<div class="topic-metadata">

**Author:** [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Replies:** 6\
**Last updated:** [September 22, 2025, 5:53pm UTC](https://discourse.julialang.org/t/discretization-of-semi-coupled-wave-and-diffusion-equations-fails-for-step-size-of-pi-25n-using-methodoflines-jl/106091 "2025-09-22T17:53:04Z")

</div>

Intro I’m using a semi-coupled system of wave and diffusion equations to simulate a string whose mass/speed of sound diffuses (as a toy to familiarize myself with MethodOfLines.jl for my master’s thesis in high-performan…

---

## [MethodOfLines: How can I compute the Jacobian of the system of ODEs?](https://discourse.julialang.org/t/methodoflines-how-can-i-compute-the-jacobian-of-the-system-of-odes/132127)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 7\
**Last updated:** [September 12, 2025, 12:28pm UTC](https://discourse.julialang.org/t/methodoflines-how-can-i-compute-the-jacobian-of-the-system-of-odes/132127 "2025-09-12T12:28:29Z")

</div>

How can I compute the Jacobian of the system of ODEs obtained by spatially discretising a linear advection equation? A MWE follows: using OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets @independent\_variable…

---

## [How to discretize a PDE with a Moving Boundary? (a.k.a Stefan Problem, a.k.a Variable Boundary)](https://discourse.julialang.org/t/how-to-discretize-a-pde-with-a-moving-boundary-a-k-a-stefan-problem-a-k-a-variable-boundary/123687)

<div class="topic-metadata">

**Author:** [@Jax\_Xu](https://discourse.julialang.org/u/Jax_Xu)\
**Replies:** 6\
**Last updated:** [August 26, 2025, 9:12am UTC](https://discourse.julialang.org/t/how-to-discretize-a-pde-with-a-moving-boundary-a-k-a-stefan-problem-a-k-a-variable-boundary/123687 "2025-08-26T09:12:30Z")

</div>

Hi Community! I need your expertise :sob:! I am solving a 1D diffusion equation with a moving boundary. The physical background is the reaction of gas with a solid particle, where the gas diffuses through the product lay…

---

## [Solving a free-boundary PDE by mapping to a fixed domain](https://discourse.julialang.org/t/solving-a-free-boundary-pde-by-mapping-to-a-fixed-domain/131006)

<div class="topic-metadata">

**Author:** [@naoufelcre](https://discourse.julialang.org/u/naoufelcre)\
**Replies:** 0\
**Last updated:** [July 24, 2025, 2:21pm UTC](https://discourse.julialang.org/t/solving-a-free-boundary-pde-by-mapping-to-a-fixed-domain/131006 "2025-07-24T14:21:34Z")

</div>

Hello everyone, I’m trying to solve a 1-D Free Boundary PDE using Julia and it is my first time manipulating the language for such a complex problem so I apologize if this sounds trivial to most of you. Basically, the …

---

## [Problems with MethodOfLines discretizing PDESystem involving equations of symbolic arrays](https://discourse.julialang.org/t/problems-with-methodoflines-discretizing-pdesystem-involving-equations-of-symbolic-arrays/119916)

<div class="topic-metadata">

**Author:** [@r0uv3n](https://discourse.julialang.org/u/r0uv3n)\
**Replies:** 2\
**Last updated:** [September 28, 2024, 10:14am UTC](https://discourse.julialang.org/t/problems-with-methodoflines-discretizing-pdesystem-involving-equations-of-symbolic-arrays/119916 "2024-09-28T10:14:21Z")

</div>

Hi, I’m using ModelingToolkit to do some work involving Riemannian geometry, and in particular would like to work with tensor fields in arbitrary dimension. The following is as close to a MWE as I can get my code, I thin…

---

## [Variables are Missing from Variable map in PDE](https://discourse.julialang.org/t/variables-are-missing-from-variable-map-in-pde/117707)

<div class="topic-metadata">

**Author:** [@ppinney](https://discourse.julialang.org/u/ppinney)\
**Replies:** 4\
**Last updated:** [August 5, 2024, 1:13pm UTC](https://discourse.julialang.org/t/variables-are-missing-from-variable-map-in-pde/117707 "2024-08-05T13:13:07Z")

</div>

Hello, I am trying to solve a set of coupled PDEs using MethodOfLines.jl, but I am new to both PDE solving and Julia in general. The code is based on one of the MethodOfLines.jl tutorials: using MethodOfLines, Modeling…

---

## [Reducing Numerical Diffusion in advection model using ModelingToolkit.jl and MethodOfLines.jl](https://discourse.julialang.org/t/reducing-numerical-diffusion-in-advection-model-using-modelingtoolkit-jl-and-methodoflines-jl/117135)

<div class="topic-metadata">

**Author:** [@el\_desesperado](https://discourse.julialang.org/u/el_desesperado)\
**Replies:** 7\
**Last updated:** [July 18, 2024, 8:21am UTC](https://discourse.julialang.org/t/reducing-numerical-diffusion-in-advection-model-using-modelingtoolkit-jl-and-methodoflines-jl/117135 "2024-07-18T08:21:04Z")

</div>

Hello, I have been trying to model the advection equation( du(x,t)/dt + du(x,t)/dx = 0) using ModelingToolkit.jl and MethodOfLines.jl. import OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets ModelingToolkit.…

---

## [Solving coupled PDEs with implicit time-dependence](https://discourse.julialang.org/t/solving-coupled-pdes-with-implicit-time-dependence/115191)

<div class="topic-metadata">

**Author:** [@Danny\_Han](https://discourse.julialang.org/u/Danny_Han)\
**Replies:** 1\
**Last updated:** [July 5, 2024, 6:26pm UTC](https://discourse.julialang.org/t/solving-coupled-pdes-with-implicit-time-dependence/115191 "2024-07-05T18:26:57Z")

</div>

I’m trying to implement a time-dependent Landau model for ferroelectric materials on a 2D cartesian domain, where the time-dependent Landau equation \\frac{dP}{dt} = -\\eta (\\alpha P+\\beta P^3 + \\gamma P^5 - k\_x \\frac{\\pa…

---

## [PDE with neural network and derivative of NN using MethodOfLines](https://discourse.julialang.org/t/pde-with-neural-network-and-derivative-of-nn-using-methodoflines/114673)

<div class="topic-metadata">

**Author:** [@jenrei](https://discourse.julialang.org/u/jenrei)\
**Replies:** 2\
**Last updated:** [June 15, 2024, 11:15am UTC](https://discourse.julialang.org/t/pde-with-neural-network-and-derivative-of-nn-using-methodoflines/114673 "2024-06-15T11:15:09Z")

</div>

I want to solve the energy equation where the potential energy is expressed by a neural network and then solved for a prescribed energy (actually temperature) profile. So a very simplified version of my problem would loo…

---

## [Periodic boundary conditions with MethodOfLines not working](https://discourse.julialang.org/t/periodic-boundary-conditions-with-methodoflines-not-working/115123)

<div class="topic-metadata">

**Author:** [@dbox](https://discourse.julialang.org/u/dbox)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 7:37am UTC](https://discourse.julialang.org/t/periodic-boundary-conditions-with-methodoflines-not-working/115123 "2024-06-04T07:37:05Z")

</div>

I’m trying to use a basic advection/diffusion equation with MethodOfLines.jl. I have an initial condition which is a Gaussian shaped density, and I’m struggling to get periodic boundary conditions to work. My initial …

---

## [Error while running a PDE model using ModelingToolkit and MethodOfLines!](https://discourse.julialang.org/t/error-while-running-a-pde-model-using-modelingtoolkit-and-methodoflines/112160)

<div class="topic-metadata">

**Author:** [@aelmokadem](https://discourse.julialang.org/u/aelmokadem)\
**Replies:** 1\
**Last updated:** [April 1, 2024, 2:00am UTC](https://discourse.julialang.org/t/error-while-running-a-pde-model-using-modelingtoolkit-and-methodoflines/112160 "2024-04-01T02:00:17Z")

</div>

Hi, I am trying to solve this PDE system and getting the error below. Any ideas what I am missing here?! Thank you. Modeling code: using DifferentialEquations, ModelingToolkit, MethodOfLines, DomainSets @parameters …

---

## [Derivative of user-defined function with variables as arguments in a PDE system](https://discourse.julialang.org/t/derivative-of-user-defined-function-with-variables-as-arguments-in-a-pde-system/111597)

<div class="topic-metadata">

**Author:** [@ehintz3](https://discourse.julialang.org/u/ehintz3)\
**Replies:** 1\
**Last updated:** [March 21, 2024, 10:47pm UTC](https://discourse.julialang.org/t/derivative-of-user-defined-function-with-variables-as-arguments-in-a-pde-system/111597 "2024-03-21T22:47:36Z")

</div>

Hello, I am new to Julia, so apologies if I am missing something basic, but I wasn’t getting any replies in New To Julia, so I’m not sure that was the right place for this post. I am trying to solve a system of PDEs usin…

---

## [Number of domains in method of lines](https://discourse.julialang.org/t/number-of-domains-in-method-of-lines/109813)

<div class="topic-metadata">

**Author:** [@Sisuvoima10](https://discourse.julialang.org/u/Sisuvoima10)\
**Replies:** 0\
**Last updated:** [February 6, 2024, 2:49pm UTC](https://discourse.julialang.org/t/number-of-domains-in-method-of-lines/109813 "2024-02-06T14:49:32Z")

</div>

Hello to all, I have been trying to model a simple diffusion problem consisting from 3 different domains that are connected through interfaces. Problem is just in 1D and and the domains are connected to each other in fo…

---

## [Can I rely on consecutive state positions of a variable in discretized problem with MOL?](https://discourse.julialang.org/t/can-i-rely-on-consecutive-state-positions-of-a-variable-in-discretized-problem-with-mol/108126)

<div class="topic-metadata">

**Author:** [@progtw1](https://discourse.julialang.org/u/progtw1)\
**Replies:** 1\
**Last updated:** [December 28, 2023, 12:22pm UTC](https://discourse.julialang.org/t/can-i-rely-on-consecutive-state-positions-of-a-variable-in-discretized-problem-with-mol/108126 "2023-12-28T12:22:06Z")

</div>

MethodOfLines creates a symbolic array variable indexed over discretized spaces. After structurally simplifying the system (currently done automatically in the discretization) there are several corresponding variables i…

---

## [CUDA/GPU compatible discretization from MethodOfLines.jl](https://discourse.julialang.org/t/cuda-gpu-compatible-discretization-from-methodoflines-jl/106506)

<div class="topic-metadata">

**Author:** [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Replies:** 2\
**Last updated:** [November 21, 2023, 7:46pm UTC](https://discourse.julialang.org/t/cuda-gpu-compatible-discretization-from-methodoflines-jl/106506 "2023-11-21T19:46:03Z")

</div>

MethodOfLines.jl (MOL) exports discretize which gives an ODEProblem that can then be directly passed to OrdinaryDiffEq.solve() to get a solution. This works great if you want a CPU evaluation, but it seems not so much i…

---

## [MethodOfLines - numerical instability for example in docs](https://discourse.julialang.org/t/methodoflines-numerical-instability-for-example-in-docs/106359)

<div class="topic-metadata">

**Author:** [@Sushrut\_Deshpande](https://discourse.julialang.org/u/Sushrut_Deshpande)\
**Replies:** 1\
**Last updated:** [November 18, 2023, 5:57pm UTC](https://discourse.julialang.org/t/methodoflines-numerical-instability-for-example-in-docs/106359 "2023-11-18T17:57:57Z")

</div>

I am using the steady state heat equation example in the MethodOfLines.jl package. When I reduce the step side below 0.1 I have a numerical blow-up of the solution. I do not know if this is only on my end or other user…

---

## [Issue MethodOfLines.jl Burger equation with periodic BCs](https://discourse.julialang.org/t/issue-methodoflines-jl-burger-equation-with-periodic-bcs/104277)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 5\
**Last updated:** [October 25, 2023, 5:55pm UTC](https://discourse.julialang.org/t/issue-methodoflines-jl-burger-equation-with-periodic-bcs/104277 "2023-10-25T17:55:13Z")

</div>

Hello, I would like to solve the 1D inviscid Burgers equation \\frac{\\partial u(x,t)}{\\partial t} + \\frac{1}{2} \\frac{\\partial u(x,t)^2}{\\partial x} = 0 with periodic BCs on \[0,1\], i.e. u(0, t) = u(1,t), using MethodOfLi…

---

## [Incorporating Auxiliary Calculations as Functions in ModelingToolkit PDE Definitions, Method of Lines](https://discourse.julialang.org/t/incorporating-auxiliary-calculations-as-functions-in-modelingtoolkit-pde-definitions-method-of-lines/104428)

<div class="topic-metadata">

**Author:** [@Can\_Bozdogan](https://discourse.julialang.org/u/Can_Bozdogan)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 1:09pm UTC](https://discourse.julialang.org/t/incorporating-auxiliary-calculations-as-functions-in-modelingtoolkit-pde-definitions-method-of-lines/104428 "2023-10-03T13:09:21Z")

</div>

Hello everyone, I’ve been working on a PDE model using the ModelingToolkit, MethodOfLines, and DifferentialEquations packages, and I’ve run into some challenges that I’m hoping to get guidance on. For confidentiality re…

---

## [Method of Lines Interface index error](https://discourse.julialang.org/t/method-of-lines-interface-index-error/104402)

<div class="topic-metadata">

**Author:** [@Can\_Bozdogan](https://discourse.julialang.org/u/Can_Bozdogan)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 1:01pm UTC](https://discourse.julialang.org/t/method-of-lines-interface-index-error/104402 "2023-10-03T13:01:36Z")

</div>

Hi everyone, I’m new to Julia language, this is my first time asking a question, so please forgive me if there is any mistake in my question format. I have been working on discretizing a PDE system by using MethodOfLin…

---

## [Initialize some functions at every remake in PDEProblem](https://discourse.julialang.org/t/initialize-some-functions-at-every-remake-in-pdeproblem/102078)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 4\
**Last updated:** [August 8, 2023, 6:03pm UTC](https://discourse.julialang.org/t/initialize-some-functions-at-every-remake-in-pdeproblem/102078 "2023-08-08T18:03:36Z")

</div>

Hello, Is there a way to initialize a function in MethodOfLines so that I can “compile” it once for every parameter set, here’s an example: using ModelingToolkit, MethodOfLines, LinearAlgebra, OrdinaryDiffEq, DomainSet…
