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

Combine near axis constraints into fewer number of Objectives #528

Closed
f0uriest opened this issue Jun 2, 2023 · 3 comments · Fixed by #839
Closed

Combine near axis constraints into fewer number of Objectives #528

f0uriest opened this issue Jun 2, 2023 · 3 comments · Fixed by #839
Assignees
Labels
hackathon Stuff to work on during hackathon interface New feature or request to make the code more usable or compatibility with another code objectives Adding or improving objective functions

Comments

@f0uriest
Copy link
Member

f0uriest commented Jun 2, 2023

Right now when you get_NAE_constraints it returns a whole bunch of individual FixSumXModes objects, it would be cleaner if they were all packaged into a single object like FixNAEX, where you could instantiate it directly giving the target as some particular QSC equilibrium.

@f0uriest f0uriest added interface New feature or request to make the code more usable or compatibility with another code objectives Adding or improving objective functions labels Jun 2, 2023
@dpanici
Copy link
Collaborator

dpanici commented Oct 20, 2023

@dpanici bumping this as once #604 is merged in, NAE constrained solves will print a ton of objective errors on completion...

@f0uriest
Copy link
Member Author

We could probably make a simple kind of hacky thing like

class FixNearAxis():

    def __init__(self, eq, naeq, ...):

    def build(self):
        cons = get_near_axis_constraints(self.eq, self.naeq)
        for con in cons:
            con.build()
        self.A = np.stack([con.A for con in cons])
        self.target = np.stack([con.target for con in cons

@dpanici
Copy link
Collaborator

dpanici commented Dec 7, 2023

Make FixNearAxisR and FixNearAxisZ objectives which can take in an order to fix (0 = axis only, 1 = O(rho) etc), a DESC eq, and then the target can be one of None (in which case it fixes the current eq's near-axis behavior to the specified order), qsc where it fixes it to the given pyQSC eq, or target_array which is a user-specified target for the NAE behavior (needs to be correct size which is something like for order 1: 3 * eq,N I think

@f0uriest f0uriest added the hackathon Stuff to work on during hackathon label Mar 7, 2024
dpanici added a commit that referenced this issue Jul 25, 2024
Add a new `FixNearAxisR`,`FixNearAxisZ`, `FixNearAxisLambda` objectives
that combines all of the many `FixSumModes` objectives required for the
fixed near axis behavior constraint into single objectives, which makes
the output after a solve much more legible (only 3 errors reported
instead of 20-40, one for each FixSumModes objective)

These objectives are now created when `get_NAE_constraints` util
function is called

- [x] understand better why tolerance for QSC test had to increase

Resolves #528 

#829 should be merged in first before this one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hackathon Stuff to work on during hackathon interface New feature or request to make the code more usable or compatibility with another code objectives Adding or improving objective functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants