You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the Heat Equation example tutorial from the documentation of MethodOfLines.jl (see MRE down below). When I extract the discrete x and t values from the solution of the ODE set:
discrete_x = sol[x]
discrete_t = sol[t]
I get the following error:
UndefVarError: issymbollike not defined
Expected behavior
This code works when I downgrade ModelingToolkit v8.75.0 to v8.73.0.
The code should give discrete_x and discrete_t vectors with the discretized values of the independent variables.
Minimal Reproducible Example 👇
using OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets
# Method of Manufactured Solutions: exact solution
u_exact = (x,t) ->exp.(-t) *cos.(x)
# Parameters, variables, and derivatives@parameters t x
@variablesu(..)
Dt =Differential(t)
Dxx =Differential(x)^2# 1D PDE and boundary conditions
eq =Dt(u(t, x)) ~Dxx(u(t, x))
bcs = [u(0, x) ~cos(x),
u(t, 0) ~exp(-t),
u(t, 1) ~exp(-t) *cos(1)]
# Space and time domains
domains = [t ∈Interval(0.0, 1.0),
x ∈Interval(0.0, 1.0)]
# PDE system@named pdesys =PDESystem(eq, bcs, domains, [t, x], [u(t, x)])
# Method of lines discretization
dx =0.1
order =2
discretization =MOLFiniteDifference([x => dx], t)
# Convert the PDE problem into an ODE problem
prob =discretize(pdesys,discretization)
# Solve ODE problem
sol =solve(prob, Tsit5(), saveat=0.2)
# Plot results and compare with exact solution
discrete_x = sol[x]
discrete_t = sol[t]
solu = sol[u(t, x)]
using Plots
plt =plot()
for i ineachindex(discrete_t)
plot!(discrete_x, solu[i, :], label="Numerical, t=$(discrete_t[i])")
scatter!(discrete_x, u_exact(discrete_x, discrete_t[i]), label="Exact, t=$(discrete_t[i])")
end
plt
This is related to a question in discourse https://discourse.julialang.org/t/methodoflines/108387/2.
The workaround solution is using another branch of MethodOfLines.
After typing ] and installing the packages for the project, you also use add https://github.com/AayushSabharwal/MethodOfLines.jl#as/issymbollike
Describe the bug 🐞
I am running the Heat Equation example tutorial from the documentation of MethodOfLines.jl (see MRE down below). When I extract the discrete x and t values from the solution of the ODE set:
I get the following error:
UndefVarError:
issymbollike
not definedExpected behavior
This code works when I downgrade ModelingToolkit v8.75.0 to v8.73.0.
The code should give
discrete_x
anddiscrete_t
vectors with the discretized values of the independent variables.Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
The text was updated successfully, but these errors were encountered: