-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This doesn't work yet, but I quickly tried this out yesterday, thought I might as well put it up to look if we should pursue this. I think the main advantage is that we don't have to maintain our own code for determining the sparsity, which can more easily get out of sync. It does add some dependencies. The error I get is with DataInterpolations not supporting `::SymbolicUtils.BasicSymbolic{Real}`, which looks like this closed issue: SciML/DataInterpolations.jl#168. DataInterpolations has an [extension on Symbolics](https://github.com/SciML/DataInterpolations.jl/blob/master/ext/DataInterpolationsSymbolicsExt.jl) for this purpose, so perhaps we just need to create a minimal example and file an issue. ``` ERROR: MethodError: no method matching (::DataInterpolations.LinearInterpolation{Vector{…}, Vector{…}, Float64})(::SymbolicUtils.BasicSymbolic{Real}) Closest candidates are: (::DataInterpolations.AbstractInterpolation)(::Symbolics.Num) @ DataInterpolationsSymbolicsExt C:\Users\visser_mn\.julia\packages\DataInterpolations\NoIUa\ext\DataInterpolationsSymbolicsExt.jl:15 (::DataInterpolations.AbstractInterpolation)(::Number) @ DataInterpolations C:\Users\visser_mn\.julia\packages\DataInterpolations\NoIUa\src\DataInterpolations.jl:22 (::DataInterpolations.AbstractInterpolation)(::Number, ::Integer) @ DataInterpolations C:\Users\visser_mn\.julia\packages\DataInterpolations\NoIUa\src\DataInterpolations.jl:23 ... Stacktrace: [1] get_area_and_level(basin::Ribasim.Basin{…}, state_idx::Int64, storage::Symbolics.Num) @ Ribasim d:\repo\ribasim\Ribasim\core\src\util.jl:57 [2] set_current_basin_properties!(basin::Ribasim.Basin{…}, storage::SubArray{…}) @ Ribasim d:\repo\ribasim\Ribasim\core\src\solve.jl:43 [3] water_balance!(du::ComponentArrays.ComponentVector{…}, u::ComponentArrays.ComponentVector{…}, p::Ribasim.Parameters{…}, t::Float64) ``` It could be that there are a bunch more issues of this kind once this is resolved. If it starts to work but we don't want it, we should perhaps use it to test our manual Jacobian sparsity. --------- Co-authored-by: Bart de Koning <[email protected]>
- Loading branch information
1 parent
e8e235a
commit 9bdb262
Showing
24 changed files
with
456 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.