Created
October 7, 2019 19:58
-
-
Save fabiofortkamp/ba1fbdc51a6ed1f67d12939721ef9f28 to your computer and use it in GitHub Desktop.
How to calculate radial remanence directions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# example input parameters | |
phi_S_IV = 50 | |
# how much each segment occupies of the whole magnet region | |
fractions_phi = np.array([20,20,20,20,20]) | |
assert sum(fractions_phi) == 100 | |
# vector of segment angular widths | |
delta_phi_S_values = np.array(fractions_phi)/100 * phi_S_IV | |
# vector of initial angular coordinates of each segment | |
phi_initial = np.append(np.array([0,]),np.cumsum(delta_phi_S_values)[:-1]) | |
phi_final = phi_initial + delta_phi_S_values | |
alpha_radial = (phi_initial + phi_final)/2 | |
print(alpha_radial) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet corresponds to the problem of finding the remanence angles following this schematic figure:
There are$n_{\mathrm{IV}}$ wedge-like segments, each with its inital and final angular coordinates; each segment is represented by the index $k$ . Their "angular widths" $\Delta \phi_k$ are equivalent to the differences between final and initial angular coordinates.
The code calculates the angular coordinates of the center point of each segment.