Skip to content

Conversation

@enjoyneer87
Copy link
Owner

This pull request introduces several significant updates and improvements across the codebase, focusing on new functionality, code maintenance, and bug fixes. The most notable changes include the addition of a versatile BasisModel class for fitting and evaluating various basis functions, enhancements to MotorCAD data processing and visualization, and cleanup of phasor diagram plotting logic.

New functionality and model fitting

  • Added a comprehensive BasisModel class that supports fitting and evaluating multiple basis types (polynomial, RBF, Chebyshev, Legendre, thinplate, and tpaps), with methods for normalization, convex hull masking, degree selection, and table-based fitting. This greatly enhances the flexibility and reusability of basis function modeling in the codebase.

MotorCAD data processing and visualization

  • Introduced devPlotMCADIronLossCoeffMap, a new function for visualizing and interpolating MotorCAD FEA loss coefficient data with improved mesh and spline interpolation, facilitating more accurate and higher-resolution analysis.
  • Added comments and minor code improvements to MotorCAD-related scripts, including clearer variable loading and workspace setup. [1] [2] [3] [4] [5]

Phasor diagram plotting and cleanup

  • Removed the obsolete and overly complex blondelPhasorDiagram function, streamlining the codebase and reducing maintenance burden.
  • Simplified axis plotting in the phasor diagram logic by removing redundant quiver calls, improving clarity and maintainability.

Minor improvements and bug fixes

  • Corrected a function name typo from plot_xdxq to plot_xdyq, ensuring proper function referencing and invocation.
  • Updated JMAG version default from 210 to 222 in JmagData, ensuring compatibility with newer software releases.
  • Fixed minor formatting and assignment issues in JMAG export logic and result plotting scripts. [1] [2]This pull request introduces several new features and improvements, primarily focused on modeling, visualization, and code maintenance for electric machine data analysis. The most significant change is the addition of a flexible and extensible basis function modeling class, which supports various basis types and fitting strategies. There are also enhancements to data visualization, including new plotting functions and updates to phasor diagram routines, as well as minor bug fixes and code cleanups.

Modeling and Fitting Enhancements

  • Added new BasisModel class for flexible 2D surface fitting, supporting polynomial, RBF, Chebyshev, Legendre, thin-plate spline, and TPAPS basis functions, with normalization, convex hull masking, and automatic degree selection. (Class/BasisModel.m)

Visualization and Plotting Improvements

  • Added new function devPlotMCADIronLossCoeffMap for visualizing MotorCAD FEA iron loss coefficient maps, including interpolation and mesh plotting of flux linkage surfaces. (Class/@MotorcadData/devPlotMCADIronLossCoeffMap.m)
  • Updated phasor diagram routines by removing redundant axis quiver calls for cleaner plots. (Class/Jmag/@JmagData/phasor_diagram.m)
  • Minor bug fix to ensure proper CSV file naming in JMAG graph export. (Class/Jmag/@JmagData/jmagFcnGraphExport.m)
  • Updated function name for plotting dq maps from plot_xdxq to plot_xdyq for clarity and consistency. (Class/@DataDqMap/plot_xdyq.m)

Maintenance and Miscellaneous

  • Updated default JMAG version from '210' to '222' for compatibility with newer software. (Class/Jmag/@JmagData/JmagData.m)
  • Removed obsolete or redundant code, such as the entire blondelPhasorDiagram function. (Class/blondelPhasorDiagram.m)
  • Added reference to default MotorCAD settings for improved documentation. (Class/Motorcad/fcnACLoss.m)

Minor Fixes and Comments

  • Added comments and minor code cleanups in data export and post-processing functions for MotorCAD. (Class/@MotorcadData/exportRawLossMap.m, Class/@MotorcadData/rawPsiDataPost.m) [1] [2] [3] [4]
  • Commented out unnecessary MotorCAD server instantiation in result phasor diagram function. (Class/motorcadResultPhasorDiagram.m)This pull request introduces several updates and new features across the codebase, with a focus on new modeling capabilities, bug fixes, and improvements to phasor diagram plotting and MotorCAD/JMAG integrations. The most significant change is the addition of the new BasisModel class, which provides flexible 2D surface fitting using various basis functions. There are also improvements to MotorCAD/JMAG version handling, plotting routines, and code clarity.

New Feature: Basis Modeling

  • Added a comprehensive new class BasisModel for fitting and evaluating 2D surfaces using polynomial, RBF, Chebyshev, Legendre, thin-plate spline, and TPAPS basis functions, including normalization, convex hull masking, and automatic degree selection. (Class/BasisModel.m)

MotorCAD/JMAG Integration Improvements

  • Updated default JMAG version from '210' to '222' in JmagData to ensure compatibility with newer JMAG releases. (Class/Jmag/@JmagData/JmagData.m)
  • Improved file path and result CSV naming conventions for JMAG graph export, and clarified variable assignments. (Class/Jmag/@JmagData/jmagFcnGraphExport.m)
  • Added comments and improved clarity in MotorCAD loss export and AC loss functions. (Class/@MotorcadData/exportRawLossMap.m, Class/Motorcad/fcnACLoss.m) [1] [2]

Plotting and Visualization Updates

  • Fixed function name typo in plot_xdyq and improved phasor diagram axis plotting for better visualization. (Class/@DataDqMap/plot_xdyq.m, Class/Jmag/@JmagData/phasor_diagram.m) [1] [2]
  • Removed obsolete and redundant code from blondelPhasorDiagram to clean up the phasor diagram plotting logic. (Class/blondelPhasorDiagram.m)

Code Quality and Maintenance

  • Added comments and improved function documentation for easier understanding and maintainability. (Class/@MotorcadData/rawPsiDataPost.m, Class/motorcadResultPhasorDiagram.m) [1] [2] [3] [4]

Reference:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

enjoyneer87 and others added 30 commits July 4, 2023 18:45
McadLABCalcPackage에 MCAD 변수 추가
(work in progress) ANALYSIS  -> devRunParallelSpmd.m (with testCode.m)
(work in progress)calcConductorSize.m 설명필요
마지막 라인 수정
Motor-CAD - Lab 변수 정리 및 추가
2. DutyCycle 돌리고 따는거 함수 파일 생성
함수명을 camelCase 표기로 수정하겠습니다. 관습을 좋아하지는 않지만 이유는 관습입니다.
https://blog.naver.com/ege1001/220466932974
Emlab project section iii KSG dutyCycle and BasePoint calc
The setlegendBoxShape function in the tools/figure directory has been added to adjust the position of the legend in a graph. The function allows manual adjustment of the legend position, moving it closer to the top of the graph. This improves the visual layout of the legend.
- Added greyColor.m for generating a specific shade of grey
- Added getMinMax.m for calculating the minimum and maximum values in an array
- Added setBElecAngle.m for setting the labels, limits, and grid of a plot
- Added setgcaXYcoor.m for setting the labels, grid, and legend box shape of a plot
- Added plotBoxChart.m for plotting a box chart with customizable properties
- Added calcEpL.m for calculating the equivalent parallel inductance
- Added calcNonDimParaGamma.m for calculating the non-dimensional parameter gamma
- Added defHYBProxNameList.m for defining a list of display names
- Added eqHyperbolic.m for calculating the origin, new1term, and new2term values
- Added dev_plot3DVectorB.m for plotting 3D vector B with specific axis limits
- Added calcCentroid.m for calculating the centroid from node coordinates
- Added mlxToTempM.m for converting .mlx files to .m files with a prefix
- Added surfGriddata.m for generating a more dense grid and interpolating values
- Added calcSkinDepthModi.m for calculating the modified skin depth
- Added devFitSurf4D.m for fitting a surface to 4D data and plotting the results
- Added reduceWidthpolar.m for reducing the width of a polar plot
- Added formatterSCI_IdIq.m for formatting a figure with specific labels
- Added restoreView.m for restoring the axis, view, and data aspect ratio of a plot
- Added convertCharCellTable2Numeric.m for converting a table with char cells to numeric values
- Added triangulatePosition.m for triangulating the position from x, y, and d values
- Added calcJeleFromMVP.m for calculating the element current density from MVP data
- Added calcHybridACLossSooHwanFromMlx.m for calculating the AC loss from J_e, J_f, S, L, and sigma
- Added fft_1d_gif.m for generating a GIF animation of a 1D FFT plot
- Added calcSkinEffFun.m for calculating the skin effect function with optional frequency argument
- Update file path in devmkBSFDTable.m to save the coefficient table with a new name.
- Comment out the loading of BdisSFDTable.mat in devcalcHYBwitHarmonicMSwithParallelPath.m and load the new coefficient table instead.
- Update file paths in dev_plot3DVectorB_4_Fq_general.m and add new functions to the end of the file.
- Update file paths in rpACLossdqSurfFromMlx.m and change "app.load" to "app.Load".
- Update file paths in dev_plot3DVectorB_4_MS_general.m and add a comment to indicate the purpose of the file.
- Add new file mlxperPJT/JEET/From38100ref_e10_WirePeriodic_Load_4k_roughCases_JouleLoss.csv.
- Update file paths in tools/fitting/plotSurf2ndPlane.m and devcalcHYBwitHarmonicMS.m.
- Add new file mlxperPJT/JEET/mkREFDqLossSpeedRatioTable.m.
- Add polyarea3D function to calculate the area of a triangle in 3D coordinates
- Add triangulatePosition function to estimate the position of an unknown point using triangulation
- Add quiver3Jmag function to plot a 3D vector field using element-based curl
- Add allocateElementConnectivity function to extract connectivity information for specific elements
- Add getNodePos function to retrieve the coordinates of selected nodes
- Add centroid2VertexValues function to convert element values from centroid to vertex values
- Add filterSmallTriangles function to filter out small triangles based on area threshold
- Add computeCurl3D function to calculate the curl of a vector field in 3D

These functions enhance the capabilities of the study module in the JMAG Designer tool, allowing for more advanced analysis and visualization of 3D electromagnetic fields.
Add a new function setIdqLabel to the tools/figure directory. This function sets the labels on the I_d and I_q axes of a plot. It ensures that the X-axis is labeled as "I_d [A]" and the Y-axis is labeled as "I_q [A]". Additionally, it adds a box and grid to the plot for better visualization.
- aedt_file_utils.py: AEDT file management and validation
- aedt_csv_validator.py: CSV result validation functions
- aedt_parallel_processor.py: Batch processing utilities
- devAEDT3DMotor_dqMap_DOE.ipynb: Main DOE processing notebook
- aedt_utils module: Connection and Maxwell wrappers
- Exclude MAT, FIG files (100MB+)
- Exclude large CSV files from JEET/From38100
- Exclude Python cache (__pycache__)
- Exclude AEDT project files
…r Maxwell 2D

- Implemented export_aedtplt.py for exporting AEDT Maxwell 2D results to .aedtplt format, including parametric sweep and time step extraction.
- Created export_aedtplt_UML.txt as a placeholder for UML diagrams.
- Developed parametric_batch_processor.py to handle batch processing of multiple AEDT projects, ensuring parametric setups and CSV validation.
- Added functions for excitation configuration and CSV export validation.
- Updated mcadActiveXparameterList.mat with changes.
- Translated the IPM optimization notebook content from English to Korean to enhance accessibility for Korean-speaking users.
- Updated the notebook to include additional outputs and logging information.
- Introduced a new `Element` class in `tools/motorCAD/pyMCAD/Element.py` to represent a 1st order triangular element with attributes for stress and strain calculations.
…zation

- Implemented a new Python script to generate random geometries for magnetic designs.
- Integrated functions for generating random parameters and checking feasibility.
- Included plotting functionality to visualize feasible designs.
- Set up a loop to iterate until a specified number of feasible designs are found or a maximum iteration limit is reached.
- Created a new utility package structure under `tool` for organizing Python utilities.
- Added `motorCAD` module with `pyMCAD` submodule containing magnetic element classes and plotting functions.
- Implemented `MagElement`, `MagneticRegion`, `MagneticRegions`, and `MagneticRegionsTimeSeries` classes for handling magnetic data.
- Developed plotting functions for magnetic data visualization including scatter and quiver plots.
- Introduced interactive plotting capabilities using `ipywidgets`.
- Added MATLAB function `calcStrandArea` for calculating the area of a strand based on its diameter.
- Updated `MCADBuildList` class to initialize message logs.
- Modified `testPlotEffiMap.mlx` file, details of changes are binary.
- Introduced `ThermalElement` and `ThermalRegion` classes to represent thermal elements and regions.
- Implemented `ThermalRegions` class to manage multiple thermal regions and their elements.
- Added functions to read and parse thermal data from files, including handling of nodes and regions.
- Created plotting functions to visualize thermal fields using Matplotlib, supporting interactive dropdown for region selection.
- Included error handling and fallback mechanisms for missing data in thermal exports.
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.

3 participants