Minimal OECT transfer-curve utilities
Project description
OECT Transfer Curve Analysis
A Python package for analyzing Organic Electrochemical Transistor (OECT) transfer characteristic curves. This library provides comprehensive tools for extracting key device parameters including transconductance, threshold voltage, and device performance metrics.
🚀 Features
- Transconductance Analysis: Calculate transconductance (gm) using robust numerical differentiation
- Threshold Voltage Extraction: Automatic Von calculation using logarithmic slope method
- Device Type Support: Support for both N-type and P-type devices
- Robust Data Processing: Built-in validation and error handling for noisy data
- Forward/Reverse Analysis: Separate analysis of forward and reverse sweep directions
- Performance Metrics: Extract maximum/minimum current points and related parameters
📦 Installation
Prerequisites
- Python 3.7 or higher
- NumPy
- Standard library dependencies
Install from source
git clone https://github.com/Durian-leader/oect_transfer/oect-transfer.git
cd oect-transfer
pip install -e .
Dependencies
pip install numpy
🔧 Quick Start
Basic Usage
import numpy as np
from oect_transfer import Transfer
# Example data: Gate voltage (Vg) and drain current (Id)
vg = np.linspace(-0.5, 0.5, 100) # Gate voltage in V
id = np.exp(vg * 10) * 1e-6 # Drain current in A (example)
# Create Transfer object
transfer = Transfer(vg, id, device_type="N")
# Access computed parameters
print(f"Maximum transconductance: {transfer.gm_max.raw:.2e} S")
print(f"Threshold voltage: {transfer.Von.raw:.3f} V")
print(f"Maximum current: {transfer.I_max.raw:.2e} A")
Advanced Analysis
# Analyze forward and reverse sweeps separately
print(f"Forward gm_max: {transfer.gm_max.forward:.2e} S")
print(f"Reverse gm_max: {transfer.gm_max.reverse:.2e} S")
# Check where maximum transconductance occurs
print(f"gm_max location: {transfer.gm_max.where}") # 'forward', 'reverse', or 'turning_point'
# Access raw data sequences
print(f"Gate voltage range: {transfer.Vg.raw.min():.2f} to {transfer.Vg.raw.max():.2f} V")
print(f"Current range: {transfer.I.raw.min():.2e} to {transfer.I.raw.max():.2e} A")
P-type Device Analysis
# For P-type devices, specify device_type="P"
transfer_p = Transfer(vg, id, device_type="P")
print(f"P-type Von: {transfer_p.Von.raw:.3f} V")
📚 API Reference
Classes
Transfer
Main class for transfer curve analysis.
Constructor:
Transfer(x, y, device_type="N")
Parameters:
x(array-like): Gate voltage data (Vg)y(array-like): Drain current data (Id)device_type(str): Device type, "N" for N-type, "P" for P-type
Attributes:
Vg(Sequence): Gate voltage data (raw, forward, reverse)I(Sequence): Drain current data (raw, forward, reverse)gm(Sequence): Transconductance datagm_max(Point): Maximum transconductance pointI_max(Point): Maximum current pointI_min(Point): Minimum current pointVon(Point): Threshold voltage point
Sequence
Data container for raw, forward, and reverse sweep data.
Attributes:
raw(NDArray): Complete datasetforward(NDArray): Forward sweep (up to maximum Vg)reverse(NDArray): Reverse sweep (from maximum Vg)
Point
Container for parameter values at specific points.
Attributes:
raw(float): Value from complete datasetwhere(str): Location ("forward", "reverse", or "turning_point")forward(float): Value from forward sweepreverse(float): Value from reverse sweep
Methods
safe_diff(f, x)
Static method for robust numerical differentiation.
Parameters:
f(array): Function valuesx(array): Independent variable values
Returns:
NDArray: Computed derivatives
🧪 Examples
Example 1: Analyzing Experimental Data
import numpy as np
import matplotlib.pyplot as plt
from oect_transfer import Transfer
# Load your experimental data
vg_data = np.loadtxt('gate_voltage.txt')
id_data = np.loadtxt('drain_current.txt')
# Create transfer object
transfer = Transfer(vg_data, id_data, device_type="N")
# Plot results
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
# Transfer curve
ax1.semilogy(transfer.Vg.raw, np.abs(transfer.I.raw))
ax1.axvline(transfer.Von.raw, color='red', linestyle='--',
label=f'Von = {transfer.Von.raw:.3f} V')
ax1.set_xlabel('Gate Voltage (V)')
ax1.set_ylabel('|Drain Current| (A)')
ax1.legend()
ax1.grid(True)
# Transconductance
ax2.plot(transfer.Vg.raw[:-1], transfer.gm.raw)
ax2.axhline(transfer.gm_max.raw, color='red', linestyle='--',
label=f'gm_max = {transfer.gm_max.raw:.2e} S')
ax2.set_xlabel('Gate Voltage (V)')
ax2.set_ylabel('Transconductance (S)')
ax2.legend()
ax2.grid(True)
plt.tight_layout()
plt.show()
Example 2: Comparing Forward and Reverse Sweeps
# Analyze hysteresis
forward_von = transfer.Von.forward
reverse_von = transfer.Von.reverse
hysteresis = abs(forward_von - reverse_von)
print(f"Forward Von: {forward_von:.3f} V")
print(f"Reverse Von: {reverse_von:.3f} V")
print(f"Hysteresis: {hysteresis:.3f} V")
# Plot forward vs reverse
plt.figure(figsize=(8, 6))
plt.semilogy(transfer.Vg.forward, np.abs(transfer.I.forward),
'b-', label='Forward')
plt.semilogy(transfer.Vg.reverse, np.abs(transfer.I.reverse),
'r--', label='Reverse')
plt.axvline(forward_von, color='blue', alpha=0.7, linestyle=':')
plt.axvline(reverse_von, color='red', alpha=0.7, linestyle=':')
plt.xlabel('Gate Voltage (V)')
plt.ylabel('|Drain Current| (A)')
plt.legend()
plt.grid(True)
plt.title('Transfer Curve: Forward vs Reverse')
plt.show()
⚠️ Important Notes
Data Requirements
- Input arrays must be 1D and of equal length
- No NaN or infinite values are allowed
- Minimum 2 data points required for meaningful analysis
- Data should span a reasonable voltage range including the device turn-on region
Device Type Selection
-
N-type devices: Use
device_type="N"(default)- Von calculated using maximum logarithmic slope
- Suitable for enhancement-mode n-channel devices
-
P-type devices: Use
device_type="P"- Von calculated using minimum logarithmic slope
- Suitable for enhancement-mode p-channel devices
Transconductance Calculation
The transconductance is calculated using a robust numerical differentiation method that:
- Uses forward, backward, and central difference schemes appropriately
- Handles turning points with averaged derivatives
- Includes safeguards against division by zero
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/Durian-leader/oect_transfer.git
cd oect-transfer
pip install -e .[dev]
Running Tests
pytest tests/
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👥 Authors
- lidonghao - Initial work - lidonghao100@outlook.com
🙏 Acknowledgments
- Thanks to the OECT research community for valuable feedback
- Inspired by standard practices in organic electronics characterization
📞 Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Contact the maintainer at lidonghao100@outlook.com
📈 Roadmap
- Add support for output characteristic analysis
- Implement mobility extraction methods
- Add data export functionality
- Develop GUI interface
- Add more device parameter extraction methods
Keywords: OECT, Organic Electrochemical Transistor, Transfer Curve, Transconductance, Threshold Voltage, Device Characterization, Python, Analysis
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oect_transfer-0.2.0.tar.gz.
File metadata
- Download URL: oect_transfer-0.2.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47af3df4172d5702a16370008e94d00c24dc883d021bff37e9c61382bd09951b
|
|
| MD5 |
17bdf6c0eaf0ef031b54513c09270238
|
|
| BLAKE2b-256 |
92cc5f4a9172d8b28ede45827f1d5d62222328d5bc7f984c4c16f2adb4c4f7dd
|
File details
Details for the file oect_transfer-0.2.0-py3-none-any.whl.
File metadata
- Download URL: oect_transfer-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
138118708942c3d9307d69f875621968d8b9f5848b81a33b056d833b0ad4e45d
|
|
| MD5 |
367c735847764fa21b77e8a0a6528f7c
|
|
| BLAKE2b-256 |
28e7ab3eb21de9582ea3975a4f1f38674d5153ac2b7eb5f02629cbadfb04cdc2
|