Contenido principal

cktblock

R2026b

Create or update linear circuit or switched circuit block

Since R2026a

Description

blockpath = cktblock(circuit,model,Name=Value) creates a linear circuit or switched circuit Simulink® block from a Simscape™ electrical diagram or subsystem or a circuit configuration object.

Note

If the named block already exists in the Simulink model, the function updates the contents of the block.

Input Arguments

collapse all

Simscape electrical diagram or subsystem or a circuit configuration object used to create the Simulink block, specified either as a schematic or as an object. For more information, see cktconfig.

The library path of the Simulink model in which the function creates and inserts the newly constructed block.

Name-Value Arguments

collapse all

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: blockpath = cktblock(circuit,model,BlockName='Power Train'); creates a Power Train block in the specified Simulink model.

Name on the icon if the function builds a Simulink block, specified as a string.

Name of the block instance in the Simulink model, specified as a string.

Device noise sources in the circuit, specified as an n×6 cell array. The function uses resistors to model the device noise sources. The cell array contains the following information:

ColumnDescription
NameThe circuit element designator.
EnabledOption to indicate if the noise source is active, specified as true or false. Set the value to true to indicate that the noise source is active.
Noise coefficientThe RMS amplitude of the noise source. If empty, the function uses Johnson/Nyquist noise value based on the value of the resistor.
Corner frequencyThe frequency below which the flicker noise has a higher amplitude than the white Gaussian noise. This value may equal zero to indicate an absence of flicker noise.
Independent noiseOption to indicate if the device noise is correlated with other noise sources, specified as true or false. Set the value to true to indicate the device noise is independent off other noise sources.
SeedAn integer used to select the sequence of random samples. A value of 0 indicates an independent noise source. For multiple device noise outputs, set the value to the same non-zero integer value for all noise sources that share the same source.

The average temperature of the circuit, specified as a real scalar in degrees Celsius.

Option to estimate and report switch losses in switched circuits. By default, this option is disabled.

Workspace variable names for switch loss parameters, specified as a table. This argument supplies the switch loss parameters as part of the part number or identifier string.

The expected switch loss parameters are:

Parameter NameUnitDescription
Part The device part number or other identification string.
CosspFOutput capacitance.µ
trnsRise time.
tfnsFall time.
VSDVDiode forward voltage.
trrnsDiode reverse recovery time.
QrrnCDiode reverse recovery charge.
dir_dtA/µsCurrent rate of change for stated reverse recovery parameters.

Map of the device designators to the corresponding part numbers or identification strings in a switch loss file, specified as a string matrix.

The first column must contain the designator for the switch device and the second column must contain the part number or identification string for the switch loss parameters of the device.

Example: cktobj = cktconfig(circuit,SwitchLossTable=“LossParameters”,SwitchLossMap=[“Q1” “BSC0904NSI”; “D1” “FX2000A”]) maps the device designators Q1 and D1 to the corresponding part numbers as defined in the switch loss file LossParameters.

Output Arguments

collapse all

The path to the constructed block, returned as a string.

Version History

Introduced in R2026a

expand all