# How to create a variable inductor in PSIM

Have you ever wanted to craft your unique circuit components within PSIM? Well, good news! With a variety of math blocks and controlled sources blocks, PSIM empowers you to do so seamlessly.

Among the most frequently customized passive components are the variable resistor, variable inductor, and variable capacitor. In this article, we'll focus on creating the variable inductor. Crafting such dynamic inductors proves exceptionally valuable when conducting parameterized studies employing tools like lookup tables and HyperStudy.

Based on this article, there are four methods to construct a variable inductor. Among those, the simplest approach involves modeling it as a controlled current source and incorporating feedback to ensure the source aligns with the inductor equation: To have a compact solution at the end it is advised to create a subcircuit and have your variable inductor circuitry saved there. So the first step it to create a new subsystem, double click into it, add a voltage controlled current source and add the necessary terminal ports for your inductor: Now the current of this source needs to be set as integral(V/L). This can be done by utilizing a unit value inductor along with a (voltage-controlled) voltage source according to Method 1 of the aforementioned article. With this method, the requested integral is just the current passing through the unit value inductor. What is left now is to measure this current and divide it by the value ‘L’ which will be an input to the subcircuit. To implement this math function, we will need two more controlled sources and a math function (2-input) block. The first source will measure the current (current-controlled voltage source [flowing -through] block) and the other will apply the Lvalue based on user input: To add the Lvalue as user input, a “Input Signal Port” is used for the subsystem along with a voltage-controlled voltage source: The final step is to divide the two signals [integral(V) / L] and also define their derivatives into the ‘Divide’ block. Omitting the derivative definitions will lead to solver problems later on so don’t forget to add those here. Now the variable inductor is complete and is also wrapped in a subcircuit. You can load that subcircuit in a schematic by Navigating to “Subcircuit” and then “Load Subcircuit”. The mathematical expression that governs its operation is implemented using PSIM source and math blocks. To verify its operation the following circuit can be applied: 