You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace design variable f with w to avoid Ansys intrinsic variable co… - #30
Replace the design variable f with w = 2*pi*f in motor2's output variable formulas (dIA_dt--dIE_dt) and excitation formulas (I_A--I_E), and in oper_params. f collides with Ansys's reserved intrinsic variable name and gets misread when used inside output variable expressions.
computation.py's create_setup() still hardcodes Nper/f and 1/(f*(PointPer-1)) for StopTime/TimeStep, shared with motor1. Extracted these into stop_time_expr()/time_step_expr() so motor1 keeps the original f-based formulas unchanged, while motor2 overrides them with w-based ones.
Verified that w reads back correctly through an output variable (equal to 2*pi*50), and that dIA_dt/Torque results are unchanged compared to a previous test where f was renamed to fr everywhere.
Updated test_design2.py to match the new oper_params.
@haitao-ZCU Please resolve the conflicts created by the merged PR:29. Basically, just copy the changes from motor2.py and test_design2.py into the new files.
@haitao-ZCU We do not want to use the default expression "Nper/f" because it contains f, which will be disallowed in a subsequent PR. I think we should remove the definition of the children stop_time_expr and time_step_expr and move them to the parent.
I have moved stop_time_expr/time_step_expr into the parent class as suggested, and it uses w now.
I also verified this modification does not change the results for motor1, I ran the old f based formula and the new w based one side by side across 3 structures (60 points total) and compared TorAvg and TorRippleRms. The results are same between f and w. I have attached the csv. f_vs_w_motor1.csv
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fwithw = 2*pi*fin motor2's output variable formulas (dIA_dt--dIE_dt) and excitation formulas (I_A--I_E), and inoper_params.fcollides with Ansys's reserved intrinsic variable name and gets misread when used inside output variable expressions.computation.py'screate_setup()still hardcodesNper/fand1/(f*(PointPer-1))forStopTime/TimeStep, shared with motor1. Extracted these intostop_time_expr()/time_step_expr()so motor1 keeps the originalf-based formulas unchanged, while motor2 overrides them withw-based ones.wreads back correctly through an output variable (equal to2*pi*50), and thatdIA_dt/Torqueresults are unchanged compared to a previous test wherefwas renamed tofreverywhere.test_design2.pyto match the newoper_params.