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

adding Spheromak solutions #2237

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mohawk811
Copy link
Contributor

Description

This will provide some functions to solve for values relevant to Spheromak equilibria.

Motivation and context

Related issues

Closes #1995

@mohawk811 mohawk811 requested a review from a team as a code owner July 3, 2023 22:09
@mohawk811 mohawk811 requested review from JaydenR2305 and removed request for a team July 3, 2023 22:09
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Thank you for submitting a pull request (PR) to PlasmaPy! ✨ The future of the project depends on contributors like you, so we deeply appreciate it! 🌱

Our contributor guide has information on:

The bottom of this page shows several checks that are run for every PR. Don't worry if something broke! We break stuff all the time. 😺 Click on "Details" to learn why a check didn't pass. Please also feel free to ask for help. We do that all the time as well. 🌸 You can find us in our chat room or weekly community meeting & office hours. Here are some tips:

  • Try fixing CI / Python 3.11 test failures first.
  • Most pre-commit.ci - pr failures can be automagically fixed by commenting pre-commit.ci autofix below, followed by a git pull to bring the changes back to your computer.
  • If pre-commit.ci - pr says that a function is too long or complex, try breaking up that function into multiple short functions that each do one thing. See also these tips on writing clean scientific software.
  • If the CI / Documentation check ends with a cryptic error message, check out our documentation troubleshooting guide.
  • For a documentation preview, click on Details next to docs/readthedocs.org:plasmapy.

If this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. ✅ If you don't get a review within a few days, please feel free to send us a reminder.

Please also use SI units within PlasmaPy, except when there is strong justification otherwise or in some examples.

We thank you once again!

@github-actions github-actions bot added the plasmapy.plasma Related to the plasmapy.plasma subpackage label Jul 3, 2023
@namurphy namurphy requested review from namurphy and removed request for JaydenR2305 July 3, 2023 22:09
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (c5bafff) 98.21% compared to head (3cb920f) 98.21%.
Report is 56 commits behind head on main.

❗ Current head 3cb920f differs from pull request most recent head c3be2fd. Consider uploading reports for the commit c3be2fd to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2237   +/-   ##
=======================================
  Coverage   98.21%   98.21%           
=======================================
  Files          98       98           
  Lines        8568     8568           
=======================================
  Hits         8415     8415           
  Misses        153      153           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mohawk811 mohawk811 marked this pull request as draft July 7, 2023 16:15
@namurphy
Copy link
Member

namurphy commented Jul 7, 2023

Here's the link that describes how to add an api_static file (and an example from #2068).


"""

return 2 * self.B0 * (self.a / r) * j1 * (self.lamb * r) * math.cos(theta)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import & use the Bessel function from (I think) SciPy?

eigenvalue to make J cross B = 0.

"""
return -1 * B0 * (a / r) * Derivative[r * j1 * (lamb * r), r] * math.sin(theta)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like SymPy has special functions for Bessel functions too.

@namurphy namurphy added this to the 2023.9.0 milestone Jul 25, 2023

class solution:
"""
Define Analytical solution for spheromak equilibria.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Define Analytical solution for spheromak equilibria.
Define Analytical solution for force-free spheromak equilibria.

from sympy import Derivative


class solution:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class solution:
class ForceFreeSpheromak:

...since I'm thinking we want to emphasize that it's force-free.

@namurphy namurphy modified the milestones: 2023.10.0, v2024.1.0 Oct 22, 2023
@namurphy namurphy removed this from the v2024.1.0 milestone Jan 17, 2024
@namurphy namurphy added this to the Future milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plasmapy.plasma Related to the plasmapy.plasma subpackage testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add classes to represent analytical solutions for spheromaks
2 participants