Variable#

class ansys.aedt.core.application.variables.Variable(expression, units=None, si_value=None, full_variables=None, name=None, app=None, readonly=False, hidden=False, sweep=True, description=None, postprocessing=False, circuit_parameter=True)[source]#

Stores design properties and project variables and provides operations to perform on them.

Parameters:
valuefloat, str

Numerical value of the variable in SI units.

unitsstr

Units for the value.

Examples

>>> from ansys.aedt.core.application.variables import Variable

Define a variable using a string value consistent with the AEDT properties.

>>> v = Variable("45mm")

Define an unitless variable with a value of 3.0.

>>> v = Variable(3.0)

Define a variable defined by a numeric result and a unit string.

>>> v = Variable(3.0 * 4.5, units="mm")
>>> assert v.numeric_value = 13.5
>>> assert v.units = "mm"

Methods

Variable.decompose()

Decompose a variable value to a floating with its unit.

Variable.format(format)

Retrieve the string value with the specified numerical formatting.

Variable.rescale_to(units)

Rescale the expression to a new unit within the current unit system.

Attributes

Variable.circuit_parameter

Circuit parameter flag value.

Variable.description

Description value.

Variable.evaluated_value

String value.

Variable.expression

Expression.

Variable.hidden

Hidden flag value.

Variable.is_optimization_enabled

"Check if optimization is enabled.

Variable.is_sensitivity_enabled

Check if Sensitivity is enabled.

Variable.is_statistical_enabled

Check if statistical is enabled.

Variable.is_tuning_enabled

Check if tuning is enabled.

Variable.name

Variable name.

Variable.numeric_value

Numeric part of the expression as a float value.

Variable.optimization_max_value

"Optimization max value.

Variable.optimization_min_value

"Optimization min value.

Variable.post_processing

Postprocessing flag value.

Variable.read_only

Read-only flag value.

Variable.sensitivity_initial_disp

"Sensitivity initial value.

Variable.sensitivity_max_value

"Sensitivity max value.

Variable.sensitivity_min_value

"Sensitivity min value.

Variable.sweep

Sweep flag value.

Variable.tuning_max_value

"Tuning max value.

Variable.tuning_min_value

"Tuning min value.

Variable.tuning_step_value

"Tuning Step value.

Variable.unit_system

Unit system of the expression as a string.

Variable.units

Units.

Variable.value

Value.