DESC icon indicating copy to clipboard operation
DESC copied to clipboard

Combine near axis constraints into fewer number of `Objectives`

Open f0uriest opened this issue 2 years ago • 3 comments
trafficstars

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 avatar Jun 02 '23 18:06 f0uriest

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

dpanici avatar Oct 20 '23 03:10 dpanici

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

f0uriest avatar Oct 20 '23 04:10 f0uriest

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

dpanici avatar Dec 07 '23 00:12 dpanici