JMAG-Designer provides the function to calculate 2D harmonic amplitude from calculation results obtained in the time and spatial axes as a response value.
Because it can simultaneously evaluate periodic components in spatial and time directions, it can be used for evaluating results that take harmonic characteristics into account.
This script creates a 2D harmonic amplitude response value for the section graph dataset at each time point.
Preconditions
- One or more magnetic field transient analysis studies have been created.
This script runs on the active magnetic field transient analysis study in the project tree. - The section graph definition has been created and its title is known.
- The 2D harmonic amplitude response value is available in JMAG-Designer v25.0 and later.
Script Function
- Create parameters for the response value to calculate the 2D harmonic amplitude.
Set the frequency order to 1, its periodicity to 1/2, spatial order to 1 and its periodicity to 1/2.
Set the start and end points of the time range. - Create the response value from the section graph by specifying the title of the target section graph.
# Copyright (c) 2026 JSOL CORPORATION
#
# This script is released under the MIT License.
# See the full license text at:
# https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/
app = designer.GetApplication()
def create2DHarmonicAmplitudeResponseValueFromSectionGraph(study, sectionName, responseVarName, calcTimeRange):
"""Create 2D harmonic amplitude response value based on the section graph"""
parameter = app.CreateResponseDataParameter(sectionName)
parameter.SetCalculationType(u"2DHarmonic")
parameter.SetHarmonic(u"1")
parameter.SetPeriodicity(u"Half")
parameter.SetSpaceHarmonic(u"1")
parameter.SetSpacePeriodicity(u"Half")
parameter.SetVariable(responseVarName)
# The 1st argumet of SetCaseRangeType
# 0:Uses all steps in all cases
# 1:Uses same value for all cases
# 2:Specifies values for each case
# 3:interval specified from the final step for all cases
parameter.SetCaseRangeType(1)
parameter.SetStartValue(calcTimeRange[0])
parameter.SetEndValue(calcTimeRange[1])
study.CreateParametricDataFromSection(sectionName, parameter)
sectionName = u"SectionArc"
responseVarName = "Harmonic2D"
calcTimeRange = [u"0.0001", u"0.0003"]
study = app.GetCurrentStudy()
create2DHarmonicAmplitudeResponseValueFromSectionGraph(study, sectionName, responseVarName, calcTimeRange)


