Calculators

Lumen to Candela online calculator & Python code

lm

°



Formula

\Omega_{sr} = 2\cdot\pi\cdot(1-\cos(\frac{\theta}{2}))
I_{v} = \frac{\Phi_v}{\Omega_{sr}}

where:

  • \theta is the apex angle in radians
  • \Omega_{sr} is the solid angle in Steradians
  • \Phi_v is the luminous flux in lux (lx).
  • I_{v} is the luminous intensity in candela (cd).

Python code

You can use the UliEngineering library like this:

from UliEngineering.Physics.Light import lumen_to_candela_by_apex_angle
from UliEngineering.EngineerIO import auto_format, auto_print

# These are equivalent:
intensity = lumen_to_candela_by_apex_angle("25 lm", "120°") # intensity = 7.9577 (cd)
intensity = lumen_to_candela_by_apex_angle(25.0, 120.0) # intensity = 7.9577 (cd)

# ... or get out a human-readable value:
intensity_str = auto_format(lumen_to_candela_by_apex_angle, "25 lm", "120°") # "7.96 cd"
# ... or print directly
auto_print(lumen_to_candela_by_apex_angle, "25 lm", "120°") # prints "7.96 cd"

In case you can’t use UliEngineering, use this Python function:

import math

def lumen_to_candela_by_apex_angle(flux, angle):
    """
    Compute the luminous intensity from the luminous flux,
    assuming that the flux of <flux> is distributed equally around
    a cone with apex angle <angle>.

    Keyword parameters
    ------------------
    flux : value, engineer string or NumPy array
        The luminous flux in Lux.
    angle : value, engineer string or NumPy array
        The apex angle of the emission cone, in degrees
        For many LEDs, this is 

    >>> lumen_to_candela_by_apex_angle(25., 120.)
    7.957747154594769
    """
    solid_angle = 2*math.pi*(1.-math.cos((angle*math.pi/180.)/2.0))
    return flux / solid_angle

# Usage example
print(lumen_to_candela_by_apex_angle(25., 120.)) # Prints 7.957747154594769 (cd)

 

Posted by Uli Köhler in Calculators, Physics

Capacitor energy from capacitance and voltage online calculator & Python code

C

V

Formula

E = \frac{1}{2}\cdot{}C\cdot{}U_p^2

Python code

You can use the UliEngineering library like this:

from UliEngineering.Electronics.Capacitors import capacitor_energy
from UliEngineering.EngineerIO import auto_format, auto_print

# These are equivalent:
energy = capacitor_energy("100 uF", "24 V") # energy = 0.0288 (J)
energy = capacitor_energy(100e-6, 24.0) # energy = 0.0288 (J)

# ... or get out a human-readable value:
energy_str = auto_format(capacitor_energy, "100 uF", "24 V") # "28.8 mJ"
# ... or print directly
auto_print(capacitor_energy, "100 uF", "24 V") # prints "28.8 mJ"

In case you can’t use UliEngineering, use this Python function:

def capacitor_energy(capacitance, voltage):
    return 0.5*capacitance*voltage*voltage

# Usage example:
print(capacitor_energy(100e-6, 24.0)) # prints 0.0288 (J)
Posted by Uli Köhler in Calculators, Electronics

X1/X2/Y1/Y2/Y4 impulse withstand rating voltage calculator (IEC 60384-14)

IEC 60384-14 specifies that X1/X2-rated capacitors shall be tested to withstand an impulse voltage of 4 kV (X1), 2.5 kV (X2, Y4), 8 kV (Y1) or 5 kV (Y2).

However these values only apply for a capacitance \leq 1 μF (except for Y1/Y4 capacitors). Use this calculator for X1/X2/Y2 capacitances > 1 μF!

F

Formula:

Up = \frac{Up_{\leq 1 μF}}{\Large\sqrt{\frac{C}{1\,000\,000\frac{μF}{F}}}}

where:

  • Up is the impulse withstand voltage rating
  • C is the capacitance in Farads
  • Up_{\leq 1 μF} is the voltage rating for that capacitor class with a capacitance of \leq 1 μF:
    • For X1-class: 4 kV
    • For X2-class: 2.5 kV
    • Y1-class impulse withstand voltage is always 8 kV no matter what capacitance
    • For Y2-class: 5 kV
    • Y4-class impulse withstand voltage is always 2.5 kV no matter what capacitance

Why is the impulse withstand voltage lower for larger capacitors?

The rationale behind the derating of the impulse withstand voltage is that larger capacitances will have sufficient capacitance so that a given overvoltage doesn’t cause a large voltage spike in the capacitor.

The formula (see above) is chosen so that the energy in the capacitor:

E = \frac{1}{2}\cdot{}C\cdot{}U_p^2

is kept constant (i.e. at the same value as for a equivalent capacitor of 1 μF).

Posted by Uli Köhler in Calculators, Compliance, Electronics

Inductive reactance online calculator & Python code

Use this online calculator to compute the reactance of an inductor in Ω at a specific frequency given its inductance.

Also see Capacitive reactance online calculator & Python code

H

Hz

Formula:

X_L = 2\pi fL

Python code:

The preferred way is to use UliEngineering’s UliEngineering.Electronics.Reactance.inductive_reactance:

from UliEngineering.Electronics.Reactance import *
# You can either pass strings like "150 uH" or values like 150e-6

inductive_reactance("150 uH", "10 MHz") # returns 9424.77796076938

Or get a human-readable value:

from UliEngineering.Electronics.Reactance import *
from UliEngineering.EngineerIO import *

# Compute value as a string
xc = auto_format(inductive_reactance, "150 uH", "10 MHz") # "9.42 kΩ"

# ... or print directly
auto_print(inductive_reactance, "150 uH", "10 MHz") # prints "9.42 kΩ"

In case you can’t use UliEngineering and you want to do it manually, here’s a minimal example:

import math
def inductive_reactance(f, l):
    """Compute the inductive reactance"""
    return 2*math.pi*f*l
Posted by Uli Köhler in Calculators, Electronics, Python

Capacitive reactance online calculator & Python code

Use this online calculator to compute the reactance of a capacitor in Ω at a specific frequency given its capacitance.

Also see Inductive reactance online calculator & Python code

F

Hz

Formula:

X_C = \frac{1}{2\pi fC}

Python code:

The preferred way is to use UliEngineering’s UliEngineering.Electronics.Reactance.capacitive_reactance:

from UliEngineering.Electronics.Reactance import *
# You can either pass strings like "150 pF" or values like 150e-12

capacitive_reactance("150 pF", "10 MHz") # returns 106.1032953945969

Or get a human-readable value:

from UliEngineering.Electronics.Reactance import *
from UliEngineering.EngineerIO import *

# Compute value as a string
xc = auto_format(capacitive_reactance, "150 pF", "10 MHz") # "106 Ω"

# ... or print directly
auto_print(capacitive_reactance, "150 pF", "10 MHz") # prints "106 Ω"

In case you can’t use UliEngineering and you want to do it manually, here’s a minimal example:

import math
def capacitive_reactance(f, c):
    """Compute the capacitive reactance"""
    return 1./(2*math.pi*f*c)
Posted by Uli Köhler in Calculators, Electronics, Python

Volts to dBµV online calculator & Python code

Use this online calculator to convert a voltage in Volts to a voltage in dBµV.

Also see dBµV to Volts online calculator & Python code

V

Formula:

U_{\text{dBµV}} = \frac{20\cdot\log(1\,000\,000 \cdot U_V)}{ \log(2) + \log(5)}

Python code:

import math
def volts_to_dbuv(v):
    """Convert a voltage in volts to a voltage in dBµV"""
    return (20*math.log(1e6 * v))/(math.log(2) + math.log(5))

 

Posted by Uli Köhler in Calculators, Electronics

dBµV to Volts online calculator & Python code

Use this online calculator to convert a voltage in dBµV to a voltage in Volts.

Also see Volts to dBµV online calculator & Python code

dBµV

Formula:

U_{\text{Volts}} = \frac{10^{\frac{U_{dBµV}}{20}}}{1\,000\,000 \frac{V}{µV}}

Python code:

def dbuv_to_volts(dbuv):
    """Convert a voltage in dBµV to a voltage in volts"""
    return (10**(dbuv/20.))/1e6

 

Posted by Uli Köhler in Calculators, Electronics