-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified: README.md Update modified: src/MechGlueDiffEqBase.jl similar, zero, precompile modified: test/test_4.jl Test zero and similar inferrable
- Loading branch information
Showing
4 changed files
with
119 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "MechGlueDiffEqBase" | ||
uuid = "2532746b-52b5-4539-9431-8bb183ab067f" | ||
authors = ["hustf <[email protected]> and contributors"] | ||
version = "0.2.2" | ||
version = "0.2.3" | ||
|
||
[deps] | ||
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
# MechGlueDiffEqBase | ||
Glue code for making [DiffEqBase](https://github.com/SciML/DiffEqBase.jl) work with units. | ||
|
||
This defines how to calculate the vector norm when the vector is given in units compatible with [Unitfu.jl](https://github.com/hustf/Unitfu.jl), from registy [M8](https://github.com/hustf/M8). The differential equation algorithms expects the norm to be unitless, as can be seen in e.g. step size estimators: | ||
This defines | ||
|
||
It also used to include glue code for [RecursiveArrayTools](https://github.com/SciML/RecursiveArrayTools.jl), which enables type-stable solution of equations with mixed units. This may not be needed after a change to Unitfu.jl v1.7.7, but the depencency is kept until further upstream testing. | ||
* how to calculate the vector norm 'ODE_DEFAULT_NORM' when the vector is given in units compatible with [Unitfu.jl](https://github.com/hustf/Unitfu.jl), from registy [M8](https://github.com/hustf/M8). The differential equation algorithms expects the norm to be unitless, as can be seen in e.g. step size estimators. | ||
|
||
* type-stable and inferrable 'zero', 'value', 'UNITLESS_ABS2', 'similar' | ||
|
||
These functions preserve types for mixed-unit vectors. E.g. [1.0kg, 2.0N, 3.0m/s, 4.0m/s]. | ||
|
||
This package also uses and reexports 'ArrayPartition' from [RecursiveArrayTools](https://github.com/SciML/RecursiveArrayTools.jl), which enables type-stable solution of equations with mixed units. It pre-compiles it with use of mixed unit vectors. | ||
|
||
|
||
Note: The way error tolerances are defined is initially confusing, but good to know: | ||
|
||
err_scaled = **error** / (**abstol** + norm(u) * **reltol**) | ||
|
||
where **bold** indicates unitful objects. | ||
|
||
The functions are adaptions of corresponding code from [DiffEqBase](https://github.com/SciML/DiffEqBase.jl/blob/6bb8830711e729ef513f2b1beb95853e4a691375/src/init.jl). | ||
Some functions are adaptions of corresponding code from [DiffEqBase](https://github.com/SciML/DiffEqBase.jl/blob/6bb8830711e729ef513f2b1beb95853e4a691375/src/init.jl). |
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