+10 XP
Scientific Notation in Python
In Python, 150e-3 means 150 × 10⁻³ = 0.15. Neuroscience uses tiny units — millivolts, picoamperes — so scientific notation keeps the code readable.
How to read it: XeY means X × 10^Y
• 150e-3 = 0.15 (150 milliseconds in seconds)
• 20e-3 = 0.02 (20 ms time constant)
• 25e-11 = 0.000000000025 (25 picoamperes)
• 100e6 = 100,000,000 (100 megaohms)
python
# All 8 LIF parameterst_max = 150e-3 # 150 ms total simulation time→ 150e-3 = 150 × 10⁻³ = 0.15 seconds
dt = 1e-3 # 1 ms time steptau = 20e-3 # 20 ms membrane time constantel = -60e-3 # -60 mV resting potentialvr = -70e-3 # -70 mV reset voltagevth = -50e-3 # -50 mV spike thresholdr = 100e6 # 100 MΩ resistancei_mean = 25e-11 # 25 pA mean currentprint(f"Simulation runs for {t_max*1000:.0f} ms")→ f-string: {t_max*1000:.0f} converts to ms, :.0f rounds to 0 decimals
print(f"Time step: {dt*1000:.1f} ms")print(f"Number of steps: {int(t_max/dt)}")print(f"Threshold: {vth*1000:.0f} mV")Run this to see the actual values. t_max/dt = 150 total steps.
Why use SI units (seconds, volts, amperes) throughout? Because the LIF equation τm·dV/dt = EL − V + R·I(t) is written in SI. If you mix millivolts with seconds, the math breaks. Stay consistent.