-
Notifications
You must be signed in to change notification settings - Fork 21
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
Compatibility with DynamicalODEProblem #108
Conversation
As the input array type is converted to `Array` in several places the user function can no longer work with the new data representation. This creates an anonymous function that can access the converted array with the correct indices.
In order to call the `taylorinteg` function in the case of `DynamicalODEProblem`s a more general dispatch is required, as the representation of `q0` is an `ArrayPartition`. This is converted to `Array` afterwards, but the conversion occurs after this call.
Creating a `Val{f}` with an anonymous function built from a `DynamicalODEFunction` fails. Simpler anonymous functions work.
This may not be compatible with the `q0` conversion.
I checked the integration results and it seems that something strange happens (and I get obviously wrong results), so clearly my current implementation affects the correctness of the algorithm. I'm not sure exactly where is the mistake, I will investigate further. |
First of all, thanks a lot for your pull request and for addressing this. Aside from the problem you have due to array conversions, which we should discuss, there are a couple of things that I think are worth mentioning/clarifying. I am not too familiar with Another option that may be interesting, if I understand properly the documentation, is to transform the partitioned ODE mentioned in the docs, to a system of first-order ODEs. I am thinking in something like defining a function Does this make any sense? |
My first try was to use But this needs a compatible data representation for |
This PR is transforming it from a partitioned ODE on an ArrayPartition to a first-order ODE on an ArrayPartition. By default, it transforms into the first order ODEs through its dispatch on ArrayPartition. |
I understand the problems that these lines may bring; trying to recall, we introduced that motivated by the fact that we dealt with Once said that, please feel free to open-up whatever you may need to allow using |
|
This is truly great and I am look very much forward to have this in the production version!!! |
Could you please add some tests, or a minimal working example, so we can help in making everything work together? |
I added some tests based on the Henon-Heiles problem. I still have to fix the I'm not sure why, but there are a lot of errors in other tests. |
Thanks! With the examples in hand, I'll take a look on them and provide some feedback. |
* Re-add OrdinaryDiffEq and remove DataStructures from Project * Update Project.toml * WIP: re-design common interface with DiffEq ecosystem * Add support for `parse_eqs` kwarg * Add stepsize control for TaylorMethod, fix TaylorMethodCache, add empty warnkeywords, add verbose kwarg * Support high-dimensional arrays in jetcoeffs!, stepsize * Fix stepping methods, re-add keyword warning list, add evaluate! method for high-dim arrays * Update common interface tests * Add time-dependent scalar ODE in common interface; fix other tests [ci skip] * Fix error message [skip ci] * Remove unused imports [skip ci] * Last minute fixes * Update .gitignore * Remove unused lines in tests * Update tests * Update tests comments * Minor fixes * Add working version of continuous callback test * Add update_jetcoeffs_cache! for callback handling * Add vector continuous callback tests in common interface * Update docs [ci skip] * Allow AbstractArray{...,N} in parsed jetcoeffs! * Update docs * Simplify oop if else block * Add StaticArrays to test deps * Add support for DynamicalODE in common interface * Add DynamicalODE tests from #108 (thanks to @SebastianM-C) * Remove timed integrations * Fix continuous and vector callbacks via overloading DiffEqBase.addsteps! for ::TaylorMethodCache * Add comments [skip ci] * In-place DynamicalODEProblem: don't convert to ODEProblem * Fix oop DynamicalODEProblem and add some tests * Fix oop ODEProblem and DynamicalODEProblem * Add/update tests * DynamicalODEProblem: when using `SVector` in oop problems, convert initial condition to mutable array * Add comments [skip ci] * Update .gitignore * Update test/common.jl * Address review * Remove show * Update TaylorSeries version
Closing, since I think this has been covered by #114 |
This PR tries to make the minimal amount of changes required with compatibility with
DynamicalODEProblem
s. Unfortunately, the explicitArray
conversions likeTaylorIntegration.jl/src/explicitode.jl
Line 634 in f3575ee
make this complicated.
With this PR, I tried to convert the
DynamicalODEFunctions
to something that can work with the plainArray
representation. The next issue was that the creation of aVal{f}
TaylorIntegration.jl/src/explicitode.jl
Line 256 in f3575ee
would fail with the above created closure. I tried replicating the problem in the REPL, but the above worked and returned an empty method list, so I disable the check to continue.
The last problem was due to the fact that the result timeseries is created using
uType
, but this is no longer valid because the data representation was converted toArray
as mentioned above. As a hack I used theeltype
ofuType
to create aVector{Vector{eltype(uType)}}
structure.With all these hacks I can successfully integrate a
DynamicalODEProblem
(in the in-place form).cc: @ChrisRackauckas