Skip to content

Commit

Permalink
personal script
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaatalay committed Nov 26, 2024
1 parent a73e158 commit 33b1b0d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sina/basic_equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
# ======================================================================================


def solve_the_equilibrium(file_name: str = "equilibrium"):
def solve_the_equilibrium(
file_name: str = "equilibrium",
):
# ======================================================================================
# Answer this question: What is the unique magnetic field in 3D space that will hold
# the plasma with the given LCFS, pressure profile, and rotational transform in
Expand All @@ -89,10 +91,9 @@ def solve_the_equilibrium(file_name: str = "equilibrium"):
Psi=1.0,
)

family_of_equilibria: desc.equilibrium.EquilibriaFamily = (
desc.continuation.solve_continuation_automatic(equilibrium, verbose=3)
family_of_equilibria = desc.continuation.solve_continuation_automatic(
equilibrium, verbose=3
)
assert isinstance(family_of_equilibria, desc.equilibrium.EquilibriaFamily)

the_best_equilibrium = family_of_equilibria[-1]
the_best_equilibrium.save(file_name)
Expand Down Expand Up @@ -195,5 +196,5 @@ def read_equilibrium_from_file(file_name: str) -> desc.equilibrium.Equilibrium:

desc.plotting.plot_comparison(
[original_equilibrium, equilibrium], labels=["Original", "Optimized"]
) # Q: No difference between the two plots?
) # Q: No difference between the two plots?
plt.show()

0 comments on commit 33b1b0d

Please sign in to comment.