Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Ansys computes only what needs the field solution. Everything downstream of it i

| in Ansys (needs the solve) | in Python (algebra on solved quantities) |
|---|---|
| torque waveform, flux linkage, `InducedVoltage`, forces, core loss | Park/Clarke dq1/dq3 (`machine_design/transforms.py`), `Rs*I`, `Lew*dI/dt`, peak search over a waveform, terminal voltage at any speed |
| torque waveform, flux linkage, `InducedVoltage`, forces, core loss | Park/Clarke dq1/dq3 (`machine_design/generic/transforms.py`), `Rs*I`, `Lew*dI/dt`, peak search over a waveform, terminal voltage at any speed |

Why:

Expand Down
1 change: 1 addition & 0 deletions machine_design/generic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .transforms import electrical_angle, to_dq, to_phases
File renamed without changes.
2 changes: 1 addition & 1 deletion motors/synrm_5f_40s.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ansys.aedt.core import Maxwell2d

from machine_design.designs.computation import ComputationBase
from machine_design.transforms import electrical_angle, to_dq
from machine_design.generic.transforms import electrical_angle, to_dq

from .synrm_3f_36s import Geometry as BaseGeometry

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dev = [
packages = [
"machine_design",
"machine_design.designs",
"machine_design.generic",
"machine_design.optimization",
"motors",
]
Expand Down
10 changes: 5 additions & 5 deletions tests/test_ansys_transforms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Live check that the Python dq transform agrees with the Ansys output variables.

`machine_design/transforms.py` and `motors/synrm_5f_40s.py`'s `set_output_vars` implement the
same five-phase Park/Clarke transform twice -- once in Python, once as Ansys expressions.
This solves one rotor with both dq1 and dq3 excited, then asserts that transforming the
per-phase quantities in Python reproduces Ansys's own dq outputs.
`machine_design/generic/transforms.py` and `motors/synrm_5f_40s.py`'s `set_output_vars`
implement the same five-phase Park/Clarke transform twice -- once in Python, once as
Ansys expressions.This solves one rotor with both dq1 and dq3 excited, then asserts that
transforming the per-phase quantities in Python reproduces Ansys's own dq outputs.

Two subjects, deliberately:

Expand All @@ -25,8 +25,8 @@

from machine_design.config import load_config
from machine_design.designs.design import Design
from machine_design.generic.transforms import to_dq
from machine_design.optimization.generators import HacklGenerator_OneLambda
from machine_design.transforms import to_dq
from motors.synrm_5f_40s import Computation, Geometry

pytestmark = pytest.mark.ansys
Expand Down
2 changes: 1 addition & 1 deletion tests/test_synrm_5f_40s.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pytest

from machine_design.transforms import electrical_angle, to_dq
from machine_design.generic.transforms import electrical_angle, to_dq
from motors.synrm_3f_36s import Geometry as BaseGeometry
from motors.synrm_5f_40s import Computation, Geometry

Expand Down
4 changes: 2 additions & 2 deletions tests/test_transforms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Pins the m-phase dq convention used by `machine_design.transforms`.
"""Pins the m-phase dq convention used by `machine_design.generic.transforms`.

These need no Ansys. They exist because the same transform is written out by hand in
`motors/synrm_5f_40s.py`'s output variables, and a silent disagreement between the two
Expand All @@ -12,7 +12,7 @@
import numpy as np
import pytest

from machine_design.transforms import electrical_angle, to_dq, to_phases
from machine_design.generic.transforms import electrical_angle, to_dq, to_phases

THETA = np.linspace(0.0, 2.0 * np.pi, 37)

Expand Down
Loading