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

use separate rho_M_para and rho_M_perp profiles during contract_mag #173

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

bmaranville
Copy link
Member

Would fix #172 I think.

@bmaranville
Copy link
Member Author

Discussed with @acaruana2009 and seems like a good idea to merge now. We noticed that in principle the divide-by-zero error should be a lot more common, as frequently we deal with models with theta_M == 270 or theta_M == 90 and the weight factor is proportional to math.cos(theta_M * math.pi / 180.0)

The only reason it's not occuring is because the floating-point imprecision we typically operate at means that the above cosine calculation is not exactly zero, but about epsilon away from zero.

@bmaranville bmaranville merged commit 5e36779 into master Apr 5, 2024
5 checks passed
bmaranville added a commit that referenced this pull request Apr 5, 2024
@bmaranville bmaranville deleted the contract_profile_fix branch April 5, 2024 16:56
bmaranville added a commit that referenced this pull request Apr 5, 2024
bmaranville added a commit that referenced this pull request Apr 11, 2024
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

Successfully merging this pull request may close these issues.

contract magnetic for both in-plane magnetic projections: avoid divide-by-zero error
1 participant