# Continuing bugs for SecondOrderODE problem solvers

**URL:** <https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559>\
**Category:** Numerics\
**Created:** [June 16, 2020, 11:01pm UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559 "2020-06-16T23:01:05Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 19, 2020, 2:50am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/21 "2020-06-19T02:50:12Z")

</div>

did you `]up`?

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 19, 2020, 3:50am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/22 "2020-06-19T03:50:55Z")

</div>

Huh???

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 19, 2020, 4:00am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/23 "2020-06-19T04:00:55Z")

</div>

Did you run `]up` to update your registry?

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 19, 2020, 4:31am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/24 "2020-06-19T04:31:02Z")

</div>

I don’t think that was mentioned in the github entry, but I just did it; it didn’t change any of the error messages.

This is becoming the world’s least fun scavenger hunt.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 19, 2020, 4:46am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/25 "2020-06-19T04:46:35Z")

</div>

When you updated your packages, what versions did you get?

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 20, 2020, 5:41am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/26 "2020-06-20T05:41:17Z")

</div>

Chris, I’ve become fairly certain that there’s a bug in `SecondOrderODEProblem` (probably some kind of data array mismatch) which makes it fail with all of the “stiff” solvers. (In Windows, at least.)

By changing the problem function to a set of coupled 1st-order equations, I was able to use `ODEProblem` to complete runs with `Rodas5`, `Rodas4P`, `RadauIIA5`, `KenCarp4` and `Kvaerno`.

But running as coupled 1st-order eqn’s is not optimal, because I’d assume that it would be less “energy-conserving” (not symplectic). Also, that doesn’t let me use AutoVern9.

If you have any success in getting the stiff solvers to run with `SecondOrderODEProblem`, it would be great to be able to use it.

`radau` had the same problem the one time I was able to run it at all; though I’m almost giving up on trying to get `gfortran` properly installed.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 20, 2020, 5:45am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/27 "2020-06-20T05:45:36Z")

</div>

1. This test ([https://github.com/SciML/OrdinaryDiffEq.jl/blob/master/test/interface/second\_order\_with\_first\_order\_solvers.jl](https://github.com/SciML/OrdinaryDiffEq.jl/blob/master/test/interface/second_order_with_first_order_solvers.jl)) passes with the last 2 releases since it was created. So if you’re using a recent version of OrdinaryDiffEq/DiffEqBase then you’re good.
2. Your updating issues might be JuliaPro related?
3. “But running as coupled 1st-order eqn’s is not optimal, because I’d assume that it would be less “energy-conserving” (not symplectic). Also, that doesn’t let me use AutoVern9.”, no. Using a method for first order ODEs doesn’t utilize the properties of the second order ODE in any magical way. It just does the conversion automatically. There are stiff ODE solvers that are specialized to second order ODEs (basically implicit Nystrom methods) but these haven’t been implemented yet.

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 20, 2020, 6:06am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/28 "2020-06-20T06:06:01Z")

</div>

Then I have no idea what’s going on.

You asked for my package versions, I’m not sure which ones, but here are some that might matter:

```julia
 [1dea7af3] OrdinaryDiffEq v5.39.1
 [54ca160b] ODEInterface v0.4.6
 [0c46a032] DifferentialEquations v6.14.0
 [2b5f629d] DiffEqBase v6.36.3

  [c52e3926] Atom v0.12.11 ⚲
  [aae01518] BandedMatrices v0.15.10
  [e66e0078] CompilerSupportLibraries_jll v0.3.3+0
  [864edb3b] DataStructures v0.17.15
  [e2d170a0] DataValueInterfaces v1.0.0
  [bcd4f6db] DelayDiffEq v5.24.1
  [2b5f629d] DiffEqBase v6.36.3
  [459566f4] DiffEqCallbacks v2.13.2
  [5a0ffddc] DiffEqFinancial v2.3.0
  [c894b116] DiffEqJump v6.7.7
  [77a26b50] DiffEqNoiseProcess v4.1.6
  [055956cb] DiffEqPhysics v3.2.0
  [163ba53b] DiffResults v1.0.2
  [b552c78f] DiffRules v1.0.1
  [0c46a032] DifferentialEquations v6.14.0
  [c619ae07] DimensionalPlotRecipes v1.2.0
  [6a86dc24] FiniteDiff v2.3.2
  [26cc04aa] FiniteDifferences v0.10.2
  [f6369f11] ForwardDiff v0.10.10

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 20, 2020, 6:13am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/29 "2020-06-20T06:13:25Z")

</div>

So on a standard (non-JuliaPro) installation, you did:

```julia
]up
]add DiffEqBase@6.38.4

```

and then you closed everything, opened a new REPL, and you still didn’t have the latest package versions?

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 20, 2020, 6:27am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/30 "2020-06-20T06:27:47Z")

</div>

I have to run in JuliaPro; when I first installed julia without it, I wasn’t able to load any packages at all.

Also, I tried `] up` (from JuliaPro), and it apparently trashed my installation (I couldn’t run after that), and had to uninstall Julia 1.0 completely. So I installed Julia 1.4 now. Not sure if JuliaPro will freeze again if I try `] up` again.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 20, 2020, 6:49am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/31 "2020-06-20T06:49:31Z")

</div>

Pinging @avik who might be able to help

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 20, 2020, 5:38pm UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/32 "2020-06-20T17:38:41Z")

</div>

Thanks, any advice from Avik would be great.

BTW, I succeeded in installing gfortran,  
and finally added ODEInterface without an error.  
But surprisingly I still get an error in trying to use radau  
(even after shutting down JuliaPro & re-starting):

```julia
UndefVarError: radau not defined
in top-level scope at base\util.jl:175

```

FYI:

```julia
  [54ca160b] ODEInterface v0.4.6
  [2b5f629d] DiffEqBase v6.36.3
  [0c46a032] DifferentialEquations v6.14.0
  [1dea7af3] OrdinaryDiffEq v5.39.1

```

Thanks…

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 20, 2020, 6:18pm UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/33 "2020-06-20T18:18:38Z")

</div>

My student found an error! We realized that I had to install `ODEInterfaceDiffEq` in addition to `ODEInterface`. (I was confused by the Julia Packages website, they way it’s listed I didn’t see that they were two different names; it is confusingly displayed.)

Now radau is recognized, but I get a new error:  
`**Cannot find method(s) for radau! I've tried to loadODESolvers(), but it didn't work. Please check ODEInterface.help_solversupport() and call loadODESolvers and check also this output. For further information see also ODEInterface.help_install.**`

Interestingly, you answered this issue already in “[https://github.com/SciML/ODEInterfaceDiffEq.jl/issues/12](https://github.com/SciML/ODEInterfaceDiffEq.jl/issues/12)”, but I don’t see what the solution is, since I’ve already installed both packages now:

```julia
  [54ca160b] ODEInterface v0.4.6
  [09606e27] ODEInterfaceDiffEq v3.7.0

```

Adding this call still doesn’t fix the problem:

```julia
ODEInterface.loadODESolvers()

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 20, 2020, 8:22pm UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/34 "2020-06-20T20:22:55Z")

</div>

Just do `using ODEInterface, ODEInterfaceDiffEq` and it should work. That’s what we have to do for our benchmarks for examples. It’s because ODEInterface doesn’t use the standard Julia system for handling its binaries, and it should really be changed… but in general we don’t use the Fortran methods very often anymore so this rarely shows up. Not a reason to not get it fixed though.

---

<div class="post-metadata">

**Author:** ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Post date:** [June 21, 2020, 12:43am UTC](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559/35 "2020-06-21T00:43:22Z")

</div>

I’ve done all that, `radau` still doesn’t work. `ODEInterface` simply isn’t reliable. I have to move on with my calculations and use what I’ve got working: `Vern9` with `SecondOrderODEProblem` and `Rodas5/RadauIIA5` with `ODEProblem`. That’ll have to do, I guess.

Thanks for all of your time & messages, I can move forward with this. I’m sure I’ll be posting again in the future after using these algorithms.

[Previous page](https://discourse.julialang.org/t/continuing-bugs-for-secondorderode-problem-solvers/41559.md?page=1)
