# 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 createEquationForCaseControl(designTable, varName, type, expression): """Create an equation for the case control.""" designTable.AddEquation(varName) equation = designTable.GetEquation(varName) # type of equation # 0:Value # 1:Expression # 2:ExpressioniConditionj # 3:ExpressioniFlagj equation.SetType(type) equation.SetExpression(expression) equation.SetModeling(False) equation.SetDisplayName(u"result_check") equation.SetDescription(u"Use to compare results.") equation.SetDisplayIndex(0) study = app.GetCurrentStudy() designTable = study.GetDesignTable() type = 1 varName = u"Delta1" expression = u"abs(cos(45/90))" createEquationForCaseControl(designTable, varName, type, expression)