-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
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
Non-uniform adaptive meshing #232
Comments
The non-uniform mesh refinement will only be triggered if the defect of the obtained numerical solution from solving given BVP system is higher than absolute tolerance and the initial mesh is not equidistributed, which means the BVP you want to solve is not well-posed and the |
Thanks! |
Sorry, somehow lost track of this issue
The answer is yes, the point of defect estimation and mesh refinement is to overcome such difficulty in solving such problems, you can refer to chapter 9 of "Numerical Solution of Boundary Value Problems for Ordinary Differential Equations" by U. Ascher et al, which is also the mesh selection and redistribution algorithms in MIRK and FIRK methods in BoundaryValueDiffEq.jl |
On a difficult nonlinear equation it didn't adapt? This case seems to just be because MIRK methods of high order converge very fast on this test equation, so there's no need to adapt, the starting dt choice is a sufficient approximation to the tolerance that is chosen. You'd need to also decrease the relative tolerance to make it do more. We see in the benchmarks on many equations that it very quickly can get to an error below machine epsilon for linear BVPs. I'd suspect in a nonlinear equation you'd find it generally will need to adapt though. |
Hi!
I am testing BVP solvers but cannot figure how to obtain a non-uniform meshing for BVP problems.
The mesh that I get does get adapted but remains uniform (for that, I check sol.t).
Are the non-uniform meshes (like in bvp4c in Matlab) supported by BoundaryValueDiffEq?
I use version 5.12.0.
Here is the example of the code:
`function bvp!(du, u, p, x)
du[1] = u[2]
du[2] = -u[1]
end
function bc!(residual, u, p, t)
residual[1] = u[1][1] - 0
residual[2] = u[1][end] -2
end
tspan = (0, pi/2)
u0 = [1.0, -1.0]
prob = BVProblem(bvp!, bc!, u0, tspan)
sol = solve(prob, MIRK4(), dt = 0.05, abstol = 1e-9)
plot(sol, seriestype=:scatter, lw=2)
xlabel!("x")
ylabel!("u(x)")
plot(sol.t, seriestype=:scatter, lw=2)`
Am I missing something?
Thanks a lot for the help in advance!`
The text was updated successfully, but these errors were encountered: