Skip to content

Symmetrize STRIDE Δ matrices#191

Draft
d-burg wants to merge 7 commits intodevelopfrom
stride_sym
Draft

Symmetrize STRIDE Δ matrices#191
d-burg wants to merge 7 commits intodevelopfrom
stride_sym

Conversation

@d-burg
Copy link
Collaborator

@d-burg d-burg commented Feb 4, 2025

The procedure outlined in sym.f follows the procedure written by Fitzpatrick through equation (16) (see: Benchmark.pdf). On this first pass and as far as I can tell, I've implemented all GPEC equilibrium quantities, integrals, and matrix multiplies correctly – however, the resulting matrices do not yet follow the desired symmetry properties.

One question for now: does this look like I'm calculating the J(psi_N) contour integral correctly? I'm also not totally sure about the need for jac in this case.

GPEC/stride/sym.f

Lines 148 to 165 in 4568a5c

! Calculate J(psi_N) contour integral
dtheta = twopi / real(mthsurf)
DO itheta=0,mthsurf
CALL bicube_eval(rzphi,psilim,theta(itheta),1)
rfac=SQRT(rzphi%f(1))
angle=twopi*(theta(itheta)+rzphi%f(2))
r(itheta)=ro+rfac*COS(angle)
z(itheta)=zo+rfac*SIN(angle)
jac=rzphi%f(4)
w(1,1)=(1+rzphi%fy(2))*twopi**2*rfac*r(itheta)/jac
w(1,2)=-rzphi%fy(1)*pi*r(itheta)/(rfac*jac)
delpsi=SQRT(w(1,1)**2+w(1,2)**2)
J(ising)=J(ising)+
$ (1.0/(delpsi**2))*(dtheta/twopi)!/jac !DB !!
ENDDO

And in the meantime, I'll continue checking through the rest of the algebra (f_S, f_L, etc) for any issues.

@d-burg d-burg changed the title WIP: symmetrize STRIDE Δ matrices Symmetrize STRIDE Δ matrices Feb 4, 2025
@logan-nc
Copy link
Contributor

logan-nc commented Feb 6, 2025

Your J does indeed look to be the theta integral of 1/(delpsi)^2, which is what Richard defines it as here,
image

What do you think @parkjk ?

@logan-nc
Copy link
Contributor

Any progress here @d-burg?

@d-burg
Copy link
Collaborator Author

d-burg commented Jun 24, 2025

Any progress here @d-burg?

I think I have a shot if I can set up the psi_tor spline correctly! I'll return to it this week @logan-nc

@logan-nc
Copy link
Contributor

Status @d-burg?

@logan-nc
Copy link
Contributor

@d-burg this seems to have gone stale. Let's get it merged or closed as part of your current PR push

@d-burg
Copy link
Collaborator Author

d-burg commented Feb 24, 2026

@logan-nc should we keep this on the backburner? With my latest changes to this branch (and without TJ's Fitzpatrick-specific flux coordinate "r") I still haven't been able to get the outputs looking correct. However, given how well the STRIDE and TJ Δ' values align, and how close the growth rates are on circular equilibria, I'm not sure if we need this symmetrization? This might be a good question for a future meeting with Dylan or Richard, if we can catch him at MHDW.

@logan-nc
Copy link
Contributor

Sounds good @d-burg. change the pr status from "open" to "draft" please. if/when you come back to it you can change it back

@d-burg d-burg marked this pull request as draft February 25, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants