Main Content

Variable Resistor

Discrete variable resistor

Since R2019b

  • Variable Resistor block

Simscape / Electrical / Specialized Power Systems / Passives


The Variable Resistor block represents a linear time-varying resistor. It implements a discrete variable resistor as a current source. The resistance is specified by the Simulink® input signal. The resistance value can be negative.


The block uses the following equations for the relationship between the voltage, v, across the device and the current through the inductor, i, when the resistance at port R is R:


When you use a Variable Resistor block in your model, set the powergui block Simulation type to Discrete and select the Automatically handle Discrete solver and Advanced tab solver settings of blocks parameter in the Preferences tab. The robust discrete solver is used to discretize the electrical model. Simulink signals an error if the robust discrete solver is not used.



expand all

Input port associated with the resistor. The resistance can be negative.


expand all

Specialized electrical conserving port associated with the resistor positive voltage.

Specialized electrical conserving port associated with the resistor negative voltage.


expand all

Lower limit on the absolute value of the signal at port R. This limit prevents the signal from reaching a value that has no physical meaning. The value of this parameter must be greater than 0.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2019b