Comments (11)
test_integration
group has the test for BoundaryValueDiffEq but currently the example I've pasted above is the only use case we have for BVP and we don't have any plans to add new functionality relying on BVP. Adding the test case I've posted above should be enough IMO.
from boundaryvaluediffeq.jl.
I could write an MWE but at this point I think our use case should be just added to your test suite? It keeps failing so often and it's not too complex.
That would be good yes. It sounds like we're missing something.
from boundaryvaluediffeq.jl.
Here is a full independent example:
using BoundaryValueDiffEq
struct EmbeddedTorus
R::Float64
r::Float64
end
function affine_connection!(M::EmbeddedTorus, Zc, i, a, Xc, Yc)
θ = a[1] .+ i[1]
sinθ, cosθ = sincos(θ)
Γ¹₂₂ = (M.R + M.r * cosθ) * sinθ / M.r
Γ²₁₂ = -M.r * sinθ / (M.R + M.r * cosθ)
Zc[1] = Xc[2] * Γ¹₂₂ * Yc[2]
Zc[2] = Γ²₁₂ * (Xc[1] * Yc[2] + Xc[2] * Yc[1])
return Zc
end
M = EmbeddedTorus(3, 2)
a1 = [0.5, -1.2]
a2 = [-0.5, 0.3]
i = (0, 0)
solver=MIRK4()
dt=0.05
tspan = (0.0, 1.0)
function bc1!(residual, u, p, t)
mid = div(length(u[1]), 2)
residual[1:mid] = u[1][1:mid] - a1
return residual[(mid + 1):end] = u[end][1:mid] - a2
end
function chart_log_problem!(du, u, params, t)
M, i = params
mid = div(length(u), 2)
a = u[1:mid]
dx = u[(mid + 1):end]
ddx = similar(dx)
affine_connection!(M, ddx, i, a, dx, dx)
ddx .*= -1
du[1:mid] .= dx
du[(mid + 1):end] .= ddx
return du
end
u0 = [vcat(a1, zero(a1)), vcat(a2, zero(a1))]
bvp1 = BVProblem(chart_log_problem!, bc1!, u0, tspan, (M, i))
sol1 = solve(bvp1, solver, dt=dt)
I get the error locally with
[4fba245c] ArrayInterface v7.6.1
[764a87c0] BoundaryValueDiffEq v5.5.0
[2b5f629d] DiffEqBase v6.143.0
[459566f4] DiffEqCallbacks v2.35.0
⌃ [1dea7af3] OrdinaryDiffEq v6.59.3
⌅ [731186ca] RecursiveArrayTools v2.38.10
from boundaryvaluediffeq.jl.
@mateuszbaran I will add this in our test suite. What is ddx
supposed to be in affine_connection!(M, ddx, i, a, dx, dx)
?
from boundaryvaluediffeq.jl.
Thanks! This is essentially the geodesic equation on a torus in R^3, see https://en.wikipedia.org/wiki/Geodesic#Affine_geodesics . ddx
is the second derivative in that equation. I'm using BoundaryValueDiffEq.jl to find the shortest geodesic between two points.
from boundaryvaluediffeq.jl.
I meant is ddx = zeros(2)
? it is missing in the code
from boundaryvaluediffeq.jl.
ddx
is filled by affine_connection!(M::EmbeddedTorus, Zc, i, a, Xc, Yc)
, where it's called Zc
.
from boundaryvaluediffeq.jl.
Ah, sorry, I understand now what you mean. It was supposed to be ddx = similar(dx)
. I've fixed that and tried re-running the example and now I get
Arrays with non-number element types, such as
`Array{Array{Float64}}`, are not supported by the
solvers.
which I guess is a breaking change introduced at some point recently without making a breaking release?
from boundaryvaluediffeq.jl.
I am fixing that. Basically the order of fixes will be:
- Upper Bound DiffEqBase and Patch a few failures in #152
- Then we release #152. The new way for initial guess will be
VectorOfArray(...)
from boundaryvaluediffeq.jl.
I see, thanks!
from boundaryvaluediffeq.jl.
@mateuszbaran I will also add a downstream test on Manifolds.jl. Is there a particular group I should test https://github.com/JuliaManifolds/Manifolds.jl/blob/b2d83b337e214158f64d22a39776b9a80ffd2981/test/utils.jl#L4 for boundaryvaluediffeq?
from boundaryvaluediffeq.jl.
Related Issues (20)
- Error afer updating to BoundaryValueDiffEq v5: BoundsError in `interpolation` HOT 3
- Autoselect Correct Solver for Nonlinear Least Squares HOT 2
- Support Initial Guess Function
- Continuous Benchmarking HOT 1
- Free-Final-Time TPBVP/generalized BVP
- Solution interpolation in BC with MIRK solver not working? HOT 2
- MIRK methods failed on swirling flow III when viscosity parameter is small
- Sensitivity Analysis of BVProblems HOT 3
- Pre-compilation failure HOT 1
- `TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Bastin)` doesn't work with `Shooting`
- Solving via Continuation: Interpolation error when using previous solution as initial guess HOT 3
- Example from the docs doesn't run HOT 1
- Manifolds.jl / `EmbeddedTorus` is failing again HOT 2
- MIRK4 adaptive time steps HOT 7
- Documentation
- Support Non-Vector Inputs for Multiple Shooting
- VJP Computation (for NonlinearSolve) is extremely inefficient
- Precompilation triggered at each include
- Indexing in boundary conditions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boundaryvaluediffeq.jl.