# 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 createResponseInfoReducedOrderModel(resCreateInfo, resCreateParams, calcParams): """Create a response value table (calculation method: order reduction model).""" resCreateInfo.SetCalculationType(resCreateParams[u"calculationType"]) resCreateInfo.SetTorqueCondition(resCreateParams[u"torqueCond"]) resCreateInfo.SetPole(resCreateParams[u"pole"]) resCreateInfo.SetMotorType(calcParams[u"motorType"]) # Current Phase Offset # 0:[Current Phase Offset]Automatically calculate Current Phase Offset from no-load calculations. # 1:[Current Phase Offset]Enable. # 2:[Current Phase Offset]from winding settings. resCreateInfo.SetAutoCalculationPhaseOffset(calcParams[u"autoCalcPhaseOffset"]) resCreateInfo.SetParallelJobs(calcParams[u"paraJobs"]) resCreateInfo.SetMaximumCurrent(calcParams[u"maxCurrent"]) resCreateInfo.SetMaximumSpeed(calcParams[u"MaxSpeed"]) # DQ Axis Transform Type # ValueInvariant:Consistent Units # PowerInvariant:Power Invariant resCreateInfo.SetDQAxisTransformType(calcParams[u"dqAxisTrans"]) study = app.GetCurrentStudy() cond = study.GetCondition(u"Rotor torque") resCreateInfo = study.GetCreateResponseInfo() resCreateParams = { u"calculationType" : u"ReducedOrderModel", u"torqueCond" : cond, u"pole" : 4, } calcParams = { u"motorType" : u"PMSM", u"autoCalcPhaseOffset" : 1, u"paraJobs" : 5, u"maxCurrent" : u"200", u"MaxSpeed" : u"1080", u"dqAxisTrans" : u"ValueInvariant", } createResponseInfoReducedOrderModel(resCreateInfo, resCreateParams, calcParams)