# ee.spice.semiconductorSubcircuit2lookup

Generate lookup table data for semiconductors from SPICE subcircuit

## Syntax

## Description

returns the lookup table data for the SPICE subcircuit file at the path
`lookuptable`

= ee.spice.semiconductorSubcircuit2lookup(`subcircuitFile`

,`subcircuitName`

)`subcircuitFile`

and with the file name
`subcircuitName`

. Use this function to create lookup table data that
characterizes an N-Channel MOSFET, P-Channel MOSFET, or N-Channel IGBT block.

This function supports SIMetrix 8.4.

creates a SPICE subcircuit file with the specified name-value arguments.`lookuptable`

= ee.spice.semiconductorSubcircuit2lookup(`subcircuitFile`

,`subcircuitName`

,`Name=Value`

)

## Examples

### Generate Current-Voltage Characteristics from Output Characteristics

Generate the lookup table data for the current-voltage characteristics from the output characteristics of a SPICE subcircuit.

First define the path of the subcircuit, the name of the subcircuit, and the path of the SPICE executable file.

subcircuitFile = [matlabroot '\toolbox\physmod\elec\eedemos\applications\devicecharacteristics\IAUC100N04S6L014.cir']; subcircuitName = "IAUC100N04S6L014"; SPICEPath = "C:\Program Files\SIMetrix850\bin64\Sim.exe";

Then generate the lookup table data by calling the
`semiconductorSubcircuit2lookup`

function.

lookuptable = ... ee.spice.semiconductorSubcircuit2lookup(subcircuitFile, ... subcircuitName, 'SPICEPath', SPICEPath, 'terminals', [1,2,3, 0, 5], ... 'flagIdsVgs', 0, 'flagIdsVds', 1, 'T', [27 50 150]);

## Input Arguments

`subcircuitFile`

— File path

character vector

File path of the SPICE subcircuit file from which to generate the data, specified as a character vector.

`subcircuitName`

— File name

character vector

File path of the SPICE subcircuit file from which to generate the data, specified as a character vector.

### Name-Value Arguments

Specify optional pairs of arguments as
`Name1=Value1,...,NameN=ValueN`

, where `Name`

is
the argument name and `Value`

is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.

**Example: **`'terminals'=[1,2,3,0,5]`

`SPICETool`

— Name of SPICE simulation engine

`'SIMetrix'`

(default)

Name of the SPICE simulation engine executable file, specified as
`SIMetrix`

.

`SPICEPath`

— Path of SPICE simulation engine executable file

character vector | string

Path of the SPICE simulation engine executable file, specified as a character vector or a string.

`outputPath`

— Path of generated outputs

character vector | string

Path of the generated SPICE netlists and the simulation output files, specified as a character vector or a string. If you do not specify this argument, the function uses a temporary directory to store the files and removes the temporary directory when the function completes.

`terminals`

— Vector of terminal orders

vector of scalars

Vector of terminal orders in the SPICE subcircuit, specified as a vector of scalars. The values of this vector define the ports of the semiconductor device that each node of the SPICE subcircuit connects to:

`0`

— No connection`1`

—**D**for MOSFET or**C**for IGBT`2`

—**G**for MOSFET and IGBT`3`

—**S**for MOSFET or**E**for IGBT`4`

—**B**for MOSFET and IGBT`5`

—**Tcase**for MOSFET and IGBT

The size of this vector must match the number of nodes specified in the subcircuit.

For example, if your SPICE subcircuit is ```
.SUBCKT IAUC100N04S6L014 drain
gate source Tj Tcase
```

, then define this vector as
`[1,2,3,0,5]`

.

`flagIdsVgs`

— Whether to obtain characteristics from transfer characteristics

true or `1`

(default) | false or `0`

Whether to obtain current-voltage characteristics from the transfer
characteristics, specified as a numeric or logical `1`

(true) or
`0`

(false).

If you also set `'flagIdsVds'`

to `1`

, the
function obtains the current-voltage characteristics only from transfer
characteristics.

`flagIdsVds`

— Whether to obtain characteristics from output characteristics

true or `1`

(default) | false or `0`

Whether to obtain current-voltage characteristics from the output characteristics,
specified as a numeric or logical `1`

(true) or `0`

(false).

If you also set `'flagIdsVgs'`

to `1`

, the
function obtains the current-voltage characteristics only from transfer
characteristics.

`flagCapacitance`

— Whether to return capacitance characteristics

true or `1`

(default) | false or `0`

Whether to return capacitance characteristics, specified as a numeric or logical
`1`

(true) or `0`

(false).

`flagDiodeIv`

— Whether to return diode characteristics

true or `1`

(default) | false or `0`

Whether to return diode characteristics, specified as a numeric or logical
`1`

(true) or `0`

(false).

`flagTailTransient`

— Whether to return IGBT turn-off tail current transient

true or `1`

(default) | false or `0`

Whether to return IGBT turn-off tail current transient, as a numeric or logical
`1`

(true) or `0`

(false).

`VdsRangeIdsVgs`

— Vgs or Vge transfer characteristics range

`[0, 20]`

(default) | row vector of two scalars

Range for the transfer characteristics of the MOSFET gate-source voltage,
`Vgs`

, or the IGBT gate-emitter voltage, `Vge`

, in
volts, specified as a row vector of two scalars.

`VdsStepsIdsVgs`

— Vds or Vce transfer characteristics steps

`[1:0.2:5]`

(default) | vector of scalars

Steps for the transfer characteristics of the MOSFET drain-source voltage,
`Vds`

, or the IGBT collector-emitter voltage,
`Vce`

, in volts, specified as a vector of scalars.

`VdsRangeIdsVds`

— Vds or Vce output characteristics range

`[0, 5]`

(default) | row vector of two scalars

Range for the output characteristics of the MOSFET gate-drain voltage,
`Vds`

, or the IGBT collector-emitter voltage,
`Vce`

, in volts, specified as a row vector of two scalars.

`VgsStepsIdsVds`

— Vgs or Vge output characteristics steps

`[2:3:20]`

(default) | vector of scalars

Steps for the output characteristics of the MOSFET gate-source voltage,
`Vgs`

, or the IGBT gate-emitter voltage, `Vge`

, in
volts, specified as a vector of scalars.

`VgsCapacitance`

— Vgs or Vge capacitance characteristics steps

`[-5:2:20]`

(default) | vector of scalars

Steps for the capacitance characteristics of the MOSFET gate-source voltage,
`Vgs`

, or the IGBT gate-emitter voltage, `Vge`

, in
volts, specified as as a vector of scalars.

`VdsCapacitance`

— Vds or Vce capacitance characteristics steps

`[0:5:30]`

(default) | vector of scalars

Steps for the capacitance characteristics of the MOSFET drain-source voltage,
`Vds`

, or the IGBT collector-emitter voltage,
`Vce`

, in volts, specified as as a vector of scalars.

`frequencyCapacitance`

— AC frequency for capacitance characteristics

`1e6`

(default) | positive scalar

AC frequency of the small signal for the capacitance characteristics, in Hz, specified as a positive scalar.

`ACVoltageCapacitance`

— AC amplitude for capacitance characteristics

`0.05`

(default) | positive scalar

AC amplitude of the small signal for the capacitance characteristics, in F, specified as a positive scalar.

`VdsDiodeIv`

— Vgs or Vce diode characteristics sweep range

`[0, -3]`

(default) | row vector of two nonpositive scalars

Sweep range for the diode characteristics of the MOSFET gate-source voltage,
`Vgs`

, or the IGBT collector-emitter voltage,
`Vce`

, in volts, specified as a row vector of two nonpositive
scalars.

`VceTail`

— Vce voltage for turn-off tail current characteristics

`400`

(default) | positive scalar

IGBT collector-emitter voltage, `Vce`

, in volts, for the turn-off
tail current characteristics, specified as a positive scalar.

`PulseVgeTail`

— Gate-emitter pulse amplitude for turn-off tail current characteristics

`15`

(default) | positive scalar

Amplitude of the pulse applied between the IGBT gate and emitter for the turn-off tail current characteristics, in volts specified as a positive scalar.

`PulsePeriodTail`

— Gate-emitter pulse period for turn-off tail current characteristics

`5e-6`

(default) | positive scalar

Period of the pulse applied between the IGBT gate and emitter for the turn-off tail current characteristics, in seconds, specified as a positive scalar.

`T`

— Device case temperature vectors

`27`

(default) | vector of scalars

Device case temperatures for all current-voltage characteristics, specified as a vector of scalars.

`IVSimulationTime`

— Simulation time for current-voltage characteristics

`20`

(default) | positive scalar

Simulation time for the current-voltage characteristics, in seconds, specified as a positive scalar.

`IVSimulationStepSize`

— Simulation step size for current-voltage characteristics

`0.02`

(default) | positive scalar

Simulation step size for all current-voltage characteristics, specified as a positive scalar.

`RelTol`

— Relative tolerance

`1e-3`

(default) | scalar

Relative tolerance parameter used in SPICE simulations, specified as a scalar.

`AbsTol`

— Absolute tolerance

`1e-4`

(default) | scalar

Absolute current tolerance parameter used in SPICE simulations, specified as a scalar.

`VnTol`

— Absolute voltage tolerance

`1e-2`

(default) | scalar

Absolute voltage tolerance parameter used in SPICE simulations, specified as a scalar.

`Gmin`

— Parallel conductance

`1e-6`

(default) | scalar

Parallel conductance with all non-linear devices used in SPICE simulations, in
`1/Ohm`

, specified as a scalar.

`CShunt`

— Shunt resistance

`1e-6`

(default) | scalar

Shunt resistance to capacitors used in SPICE simulations, in F, specified as a scalar.

## Output Arguments

`lookuptable`

— Table lookup data

structure

Generated lookup table data from the SPICE subcircuit file, returned as a structure with these fields:

`channel`

— Channel data

structure

Data that characterizes the channel of the SPICE subcircuit, returned as a
structure. The function returns the `channel`

structure
only when you specify the name-value arguments
`flagIdsVgs`

or `flagIdsVds`

with a value of `1`

. The structure contains these fields:

`VgsVec`

— Vgs or Vge voltage

vector of scalars

MOSFET gate-source voltages, `Vgs`

, or IGBT
gate-emitter voltages, `Vge`

, in volts, returned as a
vector of scalars.

`VdsVec`

— Vds or Vce voltage

vector of scalars

MOSFET drain-source voltages, `Vds`

, or IGBT
collector-emitter voltages, `Vce`

, in volts, returned as a
vector of scalars.

`TVec`

— Temperature

vector of scalars

Temperatures, in `degC`

, returned as a vector of
scalars.

`IdsMat`

— Drain-source or collector-emitter currents

matrix of scalars

MOSFET drain-source currents, `Ids(Vgs,Vds,T)`

, or IGBT
collector-emitter currents, `Ice(Vge,Vce,T)`

, returned as a
matrix of scalars.

`capacitance`

— Capacitance data

structure

Data that characterizes the capacitance of the SPICE subcircuit, returned as a
structure. The function returns the `capacitance`

structure only when you specify the name-value argument
`flagCapacitance`

with a value of `1`

.
The structure contains these fields:

`VgsVec`

— Vgs or Vge voltage

vector of scalars

MOSFET gate-source voltages, `Vgs`

, or IGBT
gate-emitter voltages, `Vge`

, in volts, returned as a
vector of scalars.

`VdsVec`

— Vds or Vce voltage

vector of scalars

MOSFET drain-source voltages, `Vds`

, or IGBT
collector-emitter voltages, `Vce`

, in volts, returned as a
vector of scalars.

`CgsMat`

— Cgs or Cge capacitance

matrix of scalars

MOSFET gate-source capacitance, `Cgs`

, or IGBT
gate-emitter capacitance, `Cge`

, returned as a matrix of
scalars.

`CgdMat`

— Cgd or Cgc capacitance

matrix of scalars

MOSFET gate-drain capacitance, `Cgd`

, or IGBT
gate-collector capacitance, `Cgc`

, returned as a matrix of
scalars.

`CdsVec`

— Cds or Cce voltage

vector of scalars

MOSFET drain-source capacitance, `Cds`

, or IGBT
collector-emitter capacitance, `Cce`

, returned as a vector
of scalars.

`diode`

— Diode data

structure

Data that characterizes the drain-source diode or the collector-emitter diode
of the SPICE subcircuit, returned as a structure. The function returns the
`diode`

structure only when you specify the name-value
argument `flagDiodeIv`

with a value of
`1`

. The structure contains these fields:

`VVec`

— Diode voltages

vector of positive scalars

Diode voltages, in volts, returned as a vector of scalars.

`TVec`

— Temperatures

vector of scalars

Temperatures, returned as a vector of scalars.

`IMat`

— Tabulated currents

matrix of scalars

Tabulated diode currents, `Idiode(VVec,TVec)`

, or IGBT
collector-emitter currents, `Ice(Vge,Vce,T)`

, in amperes,
returned as a matrix of scalars.

`igbtTail`

— Data of IGBT turn-off tail current transient

structure

Data that characterizes the IGBT turn-off tail current transient time,
returned as a structure. The function returns the
`igbtTail`

structure only when you specify the
name-value argument `flagTailTransient`

with a value of
`1`

. The structure contains this field:

`TT`

— Time constant for IGBT turn-off current tail transient

positive scalar

Time constant of the IGBT turn-off current tail transient, in seconds, returned as a positive scalar.

## Version History

**Introduced in R2022a**

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

# Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)