Magnetics: Constitutive Laws

Calculate B, H, and permeability for linear isotropic and anisotropic materials. Use a B–H curve for nonlinear response.

Linear, anisotropic, and nonlinear models

For the linear isotropic model, B=μ₀μrH. For anisotropy, specify a tensor in the same basis as H. Use a diagonal matrix to verify the effect along each axis before moving to a rotated basis. When using a nonlinear B–H curve, keep the requested points within its interpolation domain.

Operation reference

Jump to an operation

constitutive.vacuum_permeability

Leave the operands empty. The operation returns the model’s vacuum permeability constant in H/m.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Scalar, vector, or field | scalar or field (scalar_vector_or_field;scalar_or_field)
Units
T, A/m, H/m
Result
Numerical and diagnostic fields
Purpose
Vacuum permeability
gxtxt_api_call("MAGNETICS_API_v1", "constitutive.vacuum_permeability", args)
Recorded result · constitutive.vacuum_permeability

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value": 1.2566370614359173e-06,
  "unit": "H/m"
}

constitutive.b_from_h

A is H in A/m and B is μr. The operation applies the vacuum and relative permeabilities and returns B in T.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Scalar, vector, or field | scalar or field (scalar_vector_or_field;scalar_or_field)
Units
T, A/m, H/m
Result
Numerical and diagnostic fields
Purpose
Flux density B from magnetic field H
gxtxt_api_call("MAGNETICS_API_v1", "constitutive.b_from_h", args)
Recorded result · constitutive.b_from_h

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      10
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      1000
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 0.012566370614359171,
  "value_imaginary": 0.0,
  "permeability_unit": "H/m"
}

constitutive.h_from_b

A is the flux density B in T and operand B is μr. The operation returns H in A/m using the linear model.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Scalar, vector, or field | scalar or field (scalar_vector_or_field;scalar_or_field)
Units
T, A/m, H/m
Result
Numerical and diagnostic fields
Purpose
Magnetic field H from flux density B
gxtxt_api_call("MAGNETICS_API_v1", "constitutive.h_from_b", args)
Recorded result · constitutive.h_from_b

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      0.02
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      1000
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 15.915494309189535,
  "value_imaginary": 0.0,
  "permeability_unit": "H/m"
}

constitutive.permeability

Use the isotropic contract with an explicit relative permeability. Read the resulting absolute permeability in H/m.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Scalar, vector, or field | scalar or field (scalar_vector_or_field;scalar_or_field)
Units
T, A/m, H/m
Result
Numerical and diagnostic fields
Purpose
Magnetic permeability
gxtxt_api_call("MAGNETICS_API_v1", "constitutive.permeability", args)
Recorded result · constitutive.permeability

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      10
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      1000
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 0.0012566370614359172,
  "value_imaginary": 0.0,
  "permeability_unit": "H/m"
}

constitutive.anisotropic_b_from_h

A contains H and B contains the permeability tensor in the same basis. Apply the tensor with the axes in their declared order and orientation.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Scalar, vector, or field | scalar or field (scalar_vector_or_field;scalar_or_field)
Units
T, A/m, H/m
Result
Numerical and diagnostic fields
Purpose
Application of a positive Hermitian relative permeability tensor
gxtxt_api_call("MAGNETICS_API_v1", "constitutive.anisotropic_b_from_h", args)
Recorded result · constitutive.anisotropic_b_from_h

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      3
    ],
    "real": [
      1.0,
      2.0,
      1.0,
      0.0,
      2.0,
      1.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      3,
      3
    ],
    "real": [
      10,
      0,
      0,
      0,
      20,
      0,
      0,
      0,
      30
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      2,
      3
    ],
    "values": [
      1.2566370614359173e-05,
      2.5132741228718347e-05,
      2.5132741228718347e-05,
      0.0,
      7.539822368615503e-05,
      3.7699111843077517e-05
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      2,
      3
    ],
    "values": [
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  "permeability_unit": "H/m"
}

constitutive.nonlinear_b_from_h

A contains the H query values. B and C contain the ordered samples of the H–B curve. The response depends on the supplied curve.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Scalar, vector, or field | scalar or field (scalar_vector_or_field;scalar_or_field)
Units
T, A/m, H/m
Result
Numerical and diagnostic fields
Purpose
Interpolation of a declared monotonic B–H relation
gxtxt_api_call("MAGNETICS_API_v1", "constitutive.nonlinear_b_from_h", args)
Recorded result · constitutive.nonlinear_b_from_h:clamp

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      1
    ],
    "real": [
      -10.0,
      10.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      5,
      1
    ],
    "real": [
      -5.0,
      -2.0,
      0.0,
      2.0,
      5.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      5,
      1
    ],
    "real": [
      -0.7,
      -0.31,
      0.0,
      0.31,
      0.7
    ]
  },
  {
    "kind": "struct",
    "fields": {
      "extrapolation": {
        "kind": "text",
        "value": "clamp"
      }
    }
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      2,
      1
    ],
    "values": [
      -0.7,
      0.7
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      2,
      1
    ],
    "values": [
      0.0,
      0.0
    ]
  }
}
Rejected input or attempted run · constitutive.nonlinear_b_from_h:error

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      1
    ],
    "real": [
      -10.0,
      10.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      5,
      1
    ],
    "real": [
      -5.0,
      -2.0,
      0.0,
      2.0,
      5.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      5,
      1
    ],
    "real": [
      -0.7,
      -0.31,
      0.0,
      0.31,
      0.7
    ]
  },
  {
    "kind": "struct",
    "fields": {
      "extrapolation": {
        "kind": "text",
        "value": "error"
      }
    }
  }
]

Result preview

"GXTXT:ScriptBridge:RemoteError: MAGNETICS_API_v1/constitutive.nonlinear_b_from_h: query outside declared B-H curve"