We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://discourse.julialang.org/t/space-varying-parameter-in-pde-with-modelingtoolkit/91897/5
The text was updated successfully, but these errors were encountered:
Hi, I put up a simple minimal example highlighting this issue:
using OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets # Parameters, variables, and derivatives @parameters t x @variables u(..) 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) ~ 20, Dt(u(t, 0)) ~ 100, # Heat source Dt(u(t, 1)) ~ 0] # Zero flux # 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, Rodas4(), saveat=0.2) discrete_x = sol[x] discrete_t = sol[t] solu = sol[u(t, x)] # Temperature should increase with time
Sorry, something went wrong.
The coveted 1 char fix
fix #222
70b0e82
Successfully merging a pull request may close this issue.
https://discourse.julialang.org/t/space-varying-parameter-in-pde-with-modelingtoolkit/91897/5
The text was updated successfully, but these errors were encountered: