PCM Simulation API Reference
class JMAKModel
Implements the Johnson-Mehl-Avrami-Kolmogorov crystallization kinetics model for phase change materials.
Initialize JMAK model with material parameters.
from pcm import JMAKModel
# Initialize with default GST parameters
model = JMAKModel()
# Initialize with custom parameters
custom_params = {
'Ea': 1.8, # eV
'k0': 1e16, # 1/s
'n': 3.0 # Avrami exponent
}
model = JMAKModel(params=custom_params)
Calculate temperature-dependent crystallization rate constant.
# Calculate rate at 500K
k = model.rate_constant(500)
print(f"Rate constant at 500K: {k:.2e} 1/s")
Simulate isothermal crystallization at constant temperature.
import numpy as np
# Simulate crystallization at 500K
time = np.logspace(-9, -2, 100) # 1ns to 10ms
X = model.simulate_isothermal(T=500, t_array=time)
# Plot results
import matplotlib.pyplot as plt
plt.semilogx(time, X)
plt.xlabel('Time (s)')
plt.ylabel('Crystalline Fraction')
plt.show()
class PCMDevice
Complete PCM device model with electro-thermal coupling and phase change dynamics.
Simulate device response to voltage pulse including thermal and phase change dynamics.
from pcm import PCMDevice, create_reset_pulse
device = PCMDevice()
# Create RESET pulse
voltage, time = create_reset_pulse(V_reset=3.0, t_width=50e-9)
# Simulate device response
result = device.simulate_voltage_pulse(voltage, time)
# Access results
T_max = np.max(result['temperature'])
final_state = result['phase'][-1]
print(f"Peak temperature: {T_max:.0f} K")
print(f"Final state: {'Amorphous' if final_state < 0.5 else 'Crystalline'}")
Calculate device resistance based on phase state and temperature.
class ThresholdSwitching
Models threshold switching behavior and I-V characteristics of PCM devices.
Perform quasi-static I-V sweep with threshold switching.
class Reliability
Reliability analysis including retention and endurance modeling.
Calculate retention times using Arrhenius model.
Generate Weibull distribution for endurance analysis.
Utility Functions
Helper functions for pulse generation, data I/O, and analysis.
Generate RESET pulse waveform for amorphization.
# Generate 50ns RESET pulse at 3V
voltage, time = create_reset_pulse(V_reset=3.0, t_width=50e-9)
Generate SET pulse waveform for crystallization.
# Generate 500ns SET pulse at 1.5V
voltage, time = create_set_pulse(V_set=1.5, t_width=500e-9)
Save simulation results to file.
JavaScript API
Client-side JavaScript functions for interactive simulations.
Run JMAK crystallization simulation in browser.
// Initialize simulator
const simulator = new PCMSimulator();
// Set parameters
const params = {
Ea: 1.8, // eV
k0: 1e16, // 1/s
n: 3.0, // Avrami exponent
T: 500 // Temperature in K
};
// Run simulation
const result = simulator.runJMAK(params);
// Plot results
Plotly.newPlot('plot-div', result.traces, result.layout);
Simulate voltage pulse response.
// Simulate RESET pulse
const resetResult = simulator.simulatePulse(3.0, 50e-9);
console.log(`Peak temperature: ${resetResult.T_max} K`);
// Simulate SET pulse
const setResult = simulator.simulatePulse(1.5, 500e-9);
console.log(`Final crystallinity: ${setResult.X_final}`);