MATLAB / Octave¶
MEX extension built with Octave’s mkoctfile, compatible with both
Octave and MATLAB. Platform ZIPs (Linux x86_64, macOS Intel, macOS ARM)
are attached to each GitHub release.
API coverage¶
C API ( |
MATLAB wrapper |
|---|---|
Process configuration |
|
— |
|
— |
|
Construction / destruction |
|
|
|
|
destructor |
Model metadata (read-only properties) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
used internally by |
Diffusion |
|
|
|
|
|
|
— |
|
— |
|
— |
|
— |
Time integration |
|
|
|
|
|
— |
|
|
|
|
|
|
|
Initialisation |
|
|
|
|
|
|
|
|
|
— |
|
Bounds / validation |
|
|
|
|
|
Surface |
|
|
|
|
— |
Retention |
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
Diagnostics |
|
|
|
|
— |
|
— |
Usage¶
Install from a downloaded ZIP:
% Unzip the platform archive, then add the extracted folder to your path.
unzip('palioxis-matlab-mexmaca64.zip', '~/palioxis-matlab')
addpath('~/palioxis-matlab/palioxis-matlab')
Example:
% Set the Palioxis data root once per session.
palioxis.set_root('/path/to/palioxis');
% Construct a model from an XML configuration file.
m = palioxis.MultipleDefectModel('input.xml');
% Cached metadata available as read-only properties.
disp(m.n_gas);
disp(m.gas_names);
disp(m.defect_names);
% State vectors — sizes follow the cached dimensions.
mobile = zeros(m.n_gas, 1);
defects = zeros(m.n_trap_types, 1);
trapped = zeros(m.n_ne_traps, 1);
T = 800; % Kelvin
% Effective diffusion coefficient prefactor matrix (n_gas × n_gas).
D_eff = m.effective_diffusion_prefactor(mobile, defects, T);
% Both mobile and trapped time derivatives in a single call.
[trapped_dy, mobile_dy] = m.get_time_derivatives(mobile, defects, trapped, T);
% trapped_dy — trapped rates [n_ne_traps × 1]
% mobile_dy — mobile rates [n_gas × 1]