Inductor Energy and RL Circuit Calculator
Calculate energy stored in inductor and RL circuit behavior. Inductive time constant τ=L/R. Current rise/fall exponential curves. Used in power supplies, transformers, filters.
Visualization
Interactive visualization for Inductor Energy and RL Circuit Calculator
Inductor Energy:
- • E = ½LI²
Interactive visualization with step-by-step execution
Implementation
1class InductorRL {
2 calculateTimeConstant(inductance: number, resistance: number): number {
3 if (resistance === 0) throw new Error('Resistance cannot be zero');
4 return inductance / resistance;
5 }
6
7 storedEnergy(inductance: number, current: number): number {
8 return 0.5 * inductance * current * current;
9 }
10
11 currentRise(Imax: number, t: number, L: number, R: number): number {
12 const tau = L / R;
13 return Imax * (1 - Math.exp(-t / tau));
14 }
15
16 currentDecay(I0: number, t: number, L: number, R: number): number {
17 const tau = L / R;
18 return I0 * Math.exp(-t / tau);
19 }
20
21 inductorVoltage(L: number, dI: number, dt: number): number {
22 return L * (dI / dt);
23 }
24
25 reactance(L: number, frequency: number): number {
26 return 2 * Math.PI * frequency * L;
27 }
28
29 impedance(R: number, XL: number): { magnitude: number; phase: number } {
30 const magnitude = Math.sqrt(R * R + XL * XL);
31 const phase = Math.atan(XL / R) * (180 / Math.PI);
32 return { magnitude, phase };
33 }
34}Deep Dive
Theoretical Foundation
Energy: E = 0.5×L×I². RL time constant: τ = L/R. Current rise: I(t) = I_max(1 - e^(-tR/L)). Current decay: I(t) = I₀×e^(-tR/L). Voltage across inductor: V_L = L×dI/dt. After 5τ reaches steady state.
Complexity
Time
O(1)
O(1)
O(1)
Space
O(1)
Applications
Industry Use
Switch-mode power supplies (SMPS)
DC-DC converters and regulators
Electric motor control circuits
Transformer design and analysis
RF circuits and antenna tuning
Automotive ignition coils
Inductive charging systems
Power factor correction circuits
Use Cases
Related Algorithms
GCD (Euclidean Algorithm)
Compute the Greatest Common Divisor (GCD) of two integers using the Euclidean algorithm. Dating back to around 300 BC and appearing in Euclid's Elements, it's one of the oldest algorithms still in common use. The algorithm is based on the principle that GCD(a,b) = GCD(b, a mod b) and is remarkably efficient with O(log min(a,b)) time complexity. The GCD is the largest positive integer that divides both numbers without remainder.
LCM (Least Common Multiple)
Calculate the Least Common Multiple (LCM) of two integers - the smallest positive integer that is divisible by both numbers. The LCM is intimately related to the GCD through the formula: LCM(a,b) = |a×b| / GCD(a,b). This relationship allows us to compute LCM efficiently using the Euclidean algorithm for GCD, achieving O(log min(a,b)) time complexity instead of naive factorization methods.
Sieve of Eratosthenes
Ancient and highly efficient algorithm to find all prime numbers up to a given limit n. Invented by Greek mathematician Eratosthenes of Cyrene (276-194 BC), this sieve method systematically eliminates multiples of primes, leaving only primes in the array. With O(n log log n) time complexity, it remains one of the most practical algorithms for generating large lists of primes, vastly superior to trial division which runs in O(n² / log n) time.
Prime Factorization
Decompose a positive integer into its unique prime factor representation. Every integer greater than 1 can be expressed as a product of prime numbers in exactly one way (Fundamental Theorem of Arithmetic). This algorithm uses trial division optimized to check only up to √n, as any composite number must have a prime factor ≤ √n. Returns a map of prime factors to their powers, e.g., 360 = 2³ × 3² × 5¹.