Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#430 method to extract harmonic data from transient results #445

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

james-packer
Copy link
Contributor

This implements a method to give the user the harmonic orders, amplitudes and phase angles from a magnetic graph. These are currently easily visible in Motor-CAD, but hard to access via PyMotorCAD.

Closes #430

Example code to test with:

import ansys.motorcad.core as pym
import matplotlib.pyplot as plt

mc = pym.MotorCAD(open_new_instance=False)

orders, amp, ang = mc.get_magnetic_graph_harmonics("TerminalLineToLine12")
# orders, amp, ang = mc.get_magnetic_graph_harmonics("CoggingTorqueVW")
# orders, amp, ang = mc.get_magnetic_graph_harmonics("PhaseCurrent1")

fig, axs = plt.subplots(2)
axs[0].bar(orders, amp)
axs[1].bar(orders, ang)
plt.show()

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.49%. Comparing base (69475d2) to head (b3ecc74).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
+ Coverage   86.39%   86.49%   +0.10%     
==========================================
  Files          21       21              
  Lines        2366     2391      +25     
==========================================
+ Hits         2044     2068      +24     
- Misses        322      323       +1     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method to extract harmonic data from transient results
1 participant