Como plotar corrente de diodo Shockley em Python usando UliEngineering
Você pode plotar facilmente a corrente do diodo Shockley tanto em forma linear quanto logarítmica usando a biblioteca Python UliEngineering.
V
⚠
A
⚠
⚠
V
⚠
plot_shockley_diode_current.py
from UliEngineering.Electronics.Diode import shockley_diode_current
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('ggplot')
voltages = np.linspace(0, 0.8, 400)
current = shockley_diode_current(voltages, "1pA")
# Plot linear
plt.figure(figsize=(6, 4))
plt.plot(voltages, current)
plt.title('Shockley diode current (linear)')
plt.xlabel('Voltage (V)')
plt.ylabel('Current (A)')
plt.grid(True, which='both', linestyle='--', linewidth=0.5)
plt.tight_layout()
plt.savefig('shockley_diode_current_linear.svg')
plt.close()
# Plot logarítmico
plt.figure(figsize=(6, 4))
plt.plot(voltages, np.maximum(current, 1e-20))
plt.title('Shockley diode current (log)')
plt.xlabel('Voltage (V)')
plt.ylabel('Current (A)')
plt.yscale('log')
plt.grid(True, which='both', linestyle='--', linewidth=0.5)
plt.tight_layout()
plt.savefig('shockley_diode_current_log.svg')Check out similar posts by category:
Calculators, Electronics, Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow