-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Numerical error on conversion of coulomb to statcoulomb #24325
Conversation
✅ Hi, I am the SymPy bot (v169). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.12. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Why it is showing an AssertionError, In my former PRs also faced the same issue. How can I fix it! |
When I am using |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) before after ratio
[41d90958] [48018712]
<sympy-1.11.1^0>
- 1.27±0.04ms 830±50μs 0.65 solve.TimeSparseSystem.time_linear_eq_to_matrix(10)
- 3.63±0.09ms 1.49±0.06ms 0.41 solve.TimeSparseSystem.time_linear_eq_to_matrix(20)
- 7.03±0.1ms 2.09±0.09ms 0.30 solve.TimeSparseSystem.time_linear_eq_to_matrix(30)
Full benchmark results can be found as artifacts in GitHub Actions |
You get an |
Okay Sir ,I will! |
I tried a lot but cannot able to fix the !assertion error. Can you pls guide me for moving ahead |
The assertion error is obvious if you just change the tests without making corresponding changes in the code.
|
Ping @dyc3 for review. This pull request seems correct . Could you have a look if it is good to go in ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned with the lack of sources to justify this change, but if we are sure this is mathematically correct, then I'm good to merge this in.
This needs to have a release notes entry, please edit the PR description to add it.
Now it is fine ? |
The mathematical correctness of this change can be verified on wikipedia here in the relation between Statcoulomb and Coulomb section. |
Yup, release notes look good, thank you! |
I think this also resolves issue #24281. Could you check on your branch if the output is as desired. If yes, you should add "fixes # 24281" to the OP of the PR too. |
cgs_gauss.set_quantity_scale_factor(coulomb, speed_of_light*statcoulomb/10)
cgs_gauss.set_quantity_scale_factor(ampere, speed_of_light*statcoulomb/second/10)
cgs_gauss.set_quantity_scale_factor(volt, speed_of_light*statvolt/10**6)
#cgs_gauss.set_quantity_scale_factor(weber, 10**8*maxwell)
#cgs_gauss.set_quantity_scale_factor(tesla, 10**4*gauss)
#cgs_gauss.set_quantity_scale_factor(debye, One/10**18*statcoulomb*centimeter)
#cgs_gauss.set_quantity_scale_factor(oersted, sqrt(gram/centimeter)/second)
cgs_gauss.set_quantity_scale_factor(ohm, 10**9/speed_of_light**2*second/centimeter)
cgs_gauss.set_quantity_scale_factor(farad, One/10**9*speed_of_light**2*centimeter)
cgs_gauss.set_quantity_scale_factor(henry, 10**9/speed_of_light**2/centimeter*second**2) This changes should be required cgs_gauss.set_quantity_scale_factor(coulomb, 10*speed_of_light*statcoulomb)
cgs_gauss.set_quantity_scale_factor(ampere,10*speed_of_light*statcoulomb/second)
cgs_gauss.set_quantity_scale_factor(volt, 10**6/speed_of_light*statvolt)
#cgs_gauss.set_quantity_scale_factor(weber, 10**8*maxwell)
#cgs_gauss.set_quantity_scale_factor(tesla, 10**4*gauss)
#cgs_gauss.set_quantity_scale_factor(debye, One/10**18*statcoulomb*centimeter)
#cgs_gauss.set_quantity_scale_factor(oersted, sqrt(gram/centimeter)/second)
cgs_gauss.set_quantity_scale_factor(ohm, 10**5/speed_of_light**2*second/centimeter)
cgs_gauss.set_quantity_scale_factor(farad, One/10**5*speed_of_light**2*centimeter)
cgs_gauss.set_quantity_scale_factor(henry, 10**5/speed_of_light**2/centimeter*second**2) I need to add a commit that makes these changes. |
@dyc3 pls review it! |
assert NS(convert_to(2*henry,second**2/centimeter,cgs_gauss)) == '2.22530011210724e-12*second**2/centimeter' | ||
|
||
def test_volt_cgs_gauss(): | ||
assert convert_to(volt,statvolt,cgs_gauss) == 10**6*statvolt/299792458 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can check there
1volt = 0.0033356409519815205*statvolt
1statvolt = 299.792458
Regarding V vs statVolt, chatGPT got it wrong, too - if this PR is right, though it gets the relationship between feet and inches right. So what is the definitive source that is being used to check this?
|
As we know that |
The main thing is that statvolt is greater than volt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The math seems to check out to me, and there seems to be sufficient test coverage for what's being changed here. Looks good.
References to other Issues or PRs
fixes #24319 ,#24381 ,#24281
Brief description of what is fixed or changed
fixes numerical error in the conversion of
coulomb
andstatcoulomb
Other comments
Release Notes