Skip to content

Commit

Permalink
Merge pull request #42 from bendudson/fix-optimisation
Browse files Browse the repository at this point in the history
Fix wall intersection calculation for optimisation
  • Loading branch information
bendudson committed Jan 20, 2021
2 parents 934ced6 + b75e1e6 commit 0dc2705
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 11-optimise-coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

from freegs import optimise as opt

print("Starting optimisation")

best_eq = opt.optimise(eq, # Starting equilibrium
# List of controls
[opt.CoilRadius("P2U"),
Expand All @@ -68,6 +70,9 @@
maxgen=20, # How many generations
monitor=opt.PlotMonitor()) # Plot the best in each generation

print("Finished optimisation")

# Forces on the coils
best_eq.printForces()
best_eq.plot()

2 changes: 2 additions & 0 deletions freegs/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from .boundary import fixedBoundary, freeBoundary
from . import critical

from . import polygons

# Operators which define the G-S equation
from .gradshafranov import mu0, GSsparse, GSsparse4thOrder

Expand Down

0 comments on commit 0dc2705

Please sign in to comment.