Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to calculate radial remanence directions
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)
@fabiofortkamp

This comment has been minimized.

Copy link
Owner Author

@fabiofortkamp fabiofortkamp commented Oct 7, 2019

This snippet corresponds to the problem of finding the remanence angles following this schematic figure:

radial

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment