Skip to content
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

Bisection error with Unitful #162

Closed
tomyun opened this issue Aug 16, 2019 · 2 comments
Closed

Bisection error with Unitful #162

tomyun opened this issue Aug 16, 2019 · 2 comments

Comments

@tomyun
Copy link

tomyun commented Aug 16, 2019

using Roots
using Unitful
s = u"s"; m = u"m"
g = 9.8*m/s^2
v0 = 10m/s
y0 = 16m
y(t) = -g*t^2 + v0*t + y0
find_zero(y, 1s)
# 1.8860533706680143 s

Above example in README works as is. However, it fails when bisection method is used.

find_zero(y, (0s, 2s), Bisection())
# ERROR: DimensionError: 0.0 and 0.0 s are not dimensionally compatible.

Interestingly other methods work fine with the same bracket.

find_zero(y, (0s, 2s), FalsePosition())
find_zero(y, (0s, 2s), Roots.A42())
find_zero(y, (0s, 2s), Roots.AlefeldPotraShi())
# 1.8860533706680243 s

I guess it should have been caught in the test case if it was not commented out.

jverzani added a commit to jverzani/Roots.jl that referenced this issue Aug 16, 2019
@jverzani
Copy link
Member

Thanks for letting me know. I just pushed a fix to address this bug. But still should add Unitful to the test suite so that those tests run automatically.

jverzani added a commit that referenced this issue Aug 17, 2019
* close issue #162

* version bump
@jverzani
Copy link
Member

closed by #163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants