Skip to content

Non-uniform adaptive meshing #232

@ns-ku

Description

@ns-ku

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!`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions