Skip to content

Commit

Permalink
Finished implementing radial current term for C2020
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmoosh committed Mar 23, 2024
1 parent 024a143 commit 1e31a8f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions functions/MagFldParent.m
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,23 @@
% Radial current term introduced by Connerney et al. (2020)
% The below evaluation is as detailed from Eqs 23-25 of Wilson et al. (2023):
% https://doi.org/10.1007/s11214-023-00961-3
eBpsi0 = 2e8 * IR / rho / Rp_m; % Eq 23 of Wilson et al. (2023)
eBpsi0 = 2e8 * IR ./ rho / Rp_m; % Eq 23 of Wilson et al. (2023)
% The following are Eq 25 of Wilson et al. (2023), with the 1/rho rolled in eBpsi0
eBpsi(abs(zed) < D) = -eBpsi0 * zed / D;
eBpsi(abs(zed) >= D) = -eBpsi0 * sign(zed);
eBpsi(rho == 0) = 0; % Do this one last so it overwrites any others with rho = 0

% Different calculation of Cartesian mapping back to System III frame since we have
% eBpsi term
eBx = eBrho .* (cTheta0*cPhi0*cpsi - sPhi0*spsi) ...
+ eBzed * sTheta0*cPhi0;
eBy = eBrho .* (cpsi*cTheta0*sPhi0 + spsi*cPhi0) ...
+ eBzed * sTheta0*sPhi0;
eBz = -eBrho .* cpsi*sTheta0 + eBzed * cTheta0;
eBx = eBrho .* ( cPhi0*cTheta0*cpsi - sPhi0*spsi) ...
- eBpsi .* ( cPhi0*cTheta0*spsi + sPhi0*cpsi) ...
+ eBzed * sTheta0*cPhi0;
eBy = eBrho .* ( sPhi0*cTheta0*cpsi + cPhi0*spsi) ...
+ eBpsi .* (-sPhi0*cTheta0*spsi + cPhi0*cpsi) ...
+ eBzed * sTheta0*sPhi0;
eBz = -eBrho .* cpsi*sTheta0 ...
+ eBpsi .* sTheta0*spsi ...
+ eBzed * cTheta0;

else

Expand Down

0 comments on commit 1e31a8f

Please sign in to comment.