Query 1: Unable to connect generated simscape model of TK22E10N1 from Simulink-PS converter to the node 2
Query 2: subcircuit2ssc('TK9R6E15Q5.cir','+mylibrary');
And one other model unable to built and showing these errors
Generating Simulink library 'mylibrary_lib' in the current directory 'C:\Users\hp\Desktop\mylib' ...
Error using sscbuild (line 53)
Failed to generate 'mylibrary_lib'
Error in pm.legacy.internal.support
Error in pm.legacy.internal.support
Error in ssc_build (line 5)
[varargout{1:nargout}] = pm.legacy.internal.support('sscbuild', mfilename, varargin);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
''MOS model'' value must be either 1 or 3.
• In ee.additional.spice_semiconductors.spice_nmos
• In mylibrary.tk22e10n1_g0_00 (line 125)
.ssc file for TK9R6E15Q5 as under
component tk9r6e15q5_g0_00
% tk9r6e15q5_g0_00
% Component automatically generated from a SPICE netlist for subcircuit TK9R6E15Q5_G0_00.
% MATLAB version: 24.2.
% Simscape Electrical version: 24.2.
% Simscape code generated on: 24-Sep-2025 13:01:20
%
% The subcircuit2ssc function does not support these SPICE parameters:
% D0: tnom = 25
% D1: tnom = 25
% D2: tnom = 25
% D3: tnom = 25
% M0: a0 = 3.7587
% M0: a1 = 0
% M0: a2 = 1
% M0: acde = 1
% M0: af = 1
% M0: ags = 1.2756
% M0: alpha0 = 0
% M0: alpha1 = 0
% M0: at = 33000
% M0: b0 = 0
% M0: b1 = 0
% M0: beta0 = 30
% M0: capmod = 3
% M0: cdsc = 0.00024
% M0: cdscb = 0
% M0: cdscd = 0
% M0: cf = 0
% M0: cgdl = 1.25e-08
% M0: cgsl = 6e-09
% M0: cit = 0
% M0: cjswg = 1e-12
% M0: ckappa = 1.4
% M0: clc = 1e-07
% M0: cle = 0.6
% M0: dlc = 0
% M0: drout = 0.56
% M0: dsub = 0.56
% M0: dvt0 = 2.2
% M0: dvt0w = 0
% M0: dvt1 = 0.53
% M0: dvt1w = 5300000
% M0: dvt2 = -0.032
% M0: dvt2w = -0.032
% M0: dwb = 0
% M0: dwc = 0.8287
% M0: dwg = 0
% M0: ef = 1
% M0: eta0 = 0.08
% M0: etab = -0.07
% M0: k1 = 0.5
% M0: k2 = 0
% M0: k3 = 80
% M0: k3b = 0
% M0: keta = -0.047
% M0: kf = 0
% M0: kt1 = -1.23
% M0: kt1l = 0
% M0: kt2 = 0.022
% M0: mjswg = 0.33
% M0: mobmod = 1
% M0: moin = 15
% M0: nch = 1.7e+17
% M0: nfactor = 2.55
% M0: ngate = 0
% M0: nj = 1
% M0: nlx = 1.74e-07
% M0: noff = 1
% M0: noimod = 1
% M0: pbsw = 1
% M0: pbswg = 1
% M0: pclm = 9
% M0: pdiblc1 = 0.5808
% M0: pdiblc2 = 0.0095702
% M0: pdiblcb = 0
% M0: prt = 25500
% M0: prwb = 0
% M0: prwg = 0
% M0: pscbe1 = 424000000
% M0: pscbe2 = 1e-09
% M0: pvag = 0
% M0: rdsw = 12400
% M0: tcj = 0
% M0: tcjsw = 0
% M0: tcjswg = 0
% M0: tnom = 25
% M0: tpb = 0
% M0: tpbsw = 0
% M0: tpbswg = 0
% M0: u0 = 3000
% M0: ua = 1.0402e-11
% M0: ua1 = 4.31e-09
% M0: ub = 5.87e-19
% M0: ub1 = -7.61e-18
% M0: uc = -4.65e-11
% M0: uc1 = -5.6e-11
% M0: ute = -0.15
% M0: voff = -0.31
% M0: voffcv = 0
% M0: vsat = 85242.8201
% M0: vth0 = 5
% M0: w0 = 2.5e-06
% M0: wr = 1
% M0: xpart = 0
% M0: xti = 3
% If possible, you have to manually implement them to achieve complete
% functionality. Refer to the documentation page of the blocks relevant to
% your conversion inside the Simscape Electrical Additional Components
% library.
nodes
node_1 = foundation.electrical.electrical; % node_1
node_2 = foundation.electrical.electrical; % node_2
node_3 = foundation.electrical.electrical; % node_3
end
nodes(Access=protected, ExternalAccess=none)
node_22 = foundation.electrical.electrical;
node_10 = foundation.electrical.electrical;
end
components(ExternalAccess=observe)
M0 = ee.additional.spice_semiconductors.spice_nmos( ...
AD={1.7e-06,'m^2'}, AS={1.7e-06,'m^2'}, CBD={0,'F'}, CBS={0,'F'}, ...
CGBO={0,'F/m'}, CGDO={9e-12,'F/m'}, CGSO={8.5e-08,'F/m'}, ...
CJ={0,'F/m^2'}, CJSW={1e-12,'F/m'}, DELTA={0.0058513,'1'}, ...
ETA={0,'1'}, FC={0.5,'1'}, GAMMA={0,'V^0.5'}, IS={1e-14,'A'}, ...
JS={0,'A/m^2'}, KAPPA={0.2,'1'}, KP={1e-5,'A/V^2'}, ...
LAMBDA={0,'1/V'}, LD={0,'m'}, LENGTH={1.3e-06,'m'}, ...
LEVEL={3,'1'}, ... % <---- changed from 7 to 3
SCALE={1,'1'}, MJ={0.5,'1'}, MJSW={0.33,'1'}, N={1,'1'}, ...
NEFF={1,'1'}, NFS={0,'1/cm^2'}, NSS={1e10,'1/cm^2'}, ...
NSUB={1e17,'1/cm^3'}, NRD={0,'1'}, NRS={0,'1'}, PB={1,'V'}, ...
PD={3.4,'m'}, PHI={0.7,'V'}, PS={3.4,'m'}, RD={1,'Ohm'}, ...
RS={1,'Ohm'}, RSH={0,'Ohm'}, THETA={0,'1/V'}, TOX={4e-08,'m'}, ...
TPG={1,'1'}, UCRIT={10000,'V/cm'}, UEXP={0,'1'}, ...
U0={600,'cm^2/(V*s)'}, VMAX={0,'m/s'}, VTO={5,'V'}, ...
XJ={1.5e-07,'m'}, WIDTH={1.7,'m'}, Ci_param={3,'1'}, ...
Cov_param=2, C_param=2);
D0 = ee.additional.spice_semiconductors.spice_diode(AREA={1,'m^2'},SCALE={1,'1'},IS={9.9999e-10,'A/m^2'}, ...
IKF={Inf,'A/m^2'},ISR={0,'A/m^2'},N={1.338,'1'},NR={2,'1'},M={0.55,'1'},VJ={2.8,'V'},RS={0.0034725,'Ohm*m^2'}, ...
C_param={2,'1'},CJO={2.4e-09,'F/m^2'},FC={0.5,'1'},TT={2.2424e-08,'s'},RevBrk={2,'1'},BV={165,'V'},IBV={0.01,'A/m^2'}, ...
IBVL={1e-10,'A/m^2'},NBV={1,'1'},NBVL={1,'1'},XTI={3,'1'},EG={1.11,'eV'},TIKF={0,'K^-1'},TRS1={0,'K^-1'}, ...
TRS2={0,'K^-2'},TBV1={0,'K^-1'},TBV2={0,'K^-2'});
D1 = ee.additional.spice_semiconductors.spice_diode(AREA={1,'m^2'},SCALE={1,'1'},IS={9.9999e-10,'A/m^2'}, ...
IKF={Inf,'A/m^2'},ISR={0,'A/m^2'},N={1.338,'1'},NR={2,'1'},M={0.5,'1'},VJ={5,'V'},RS={0.0034725,'Ohm*m^2'}, ...
C_param={2,'1'},CJO={1.7e-10,'F/m^2'},FC={0.5,'1'},TT={2.2424e-08,'s'},RevBrk={2,'1'},BV={Inf,'V'},IBV={1e-10,'A/m^2'}, ...
IBVL={1e-10,'A/m^2'},NBV={1,'1'},NBVL={1,'1'},XTI={3,'1'},EG={1.11,'eV'},TIKF={0,'K^-1'},TRS1={0,'K^-1'}, ...
TRS2={0,'K^-2'},TBV1={0,'K^-1'},TBV2={0,'K^-2'});
D2 = ee.additional.spice_semiconductors.spice_diode(AREA={1,'m^2'},SCALE={1,'1'},IS={1e-15,'A/m^2'},IKF={Inf,'A/m^2'}, ...
ISR={0,'A/m^2'},N={1,'1'},NR={2,'1'},M={0.5,'1'},VJ={1,'V'},RS={1e-12,'Ohm*m^2'},C_param={2,'1'},CJO={0,'F/m^2'}, ...
FC={0.5,'1'},TT={0,'s'},RevBrk={2,'1'},BV={Inf,'V'},IBV={1e-10,'A/m^2'},IBVL={1e-10,'A/m^2'},NBV={1,'1'}, ...
NBVL={1,'1'},XTI={3,'1'},EG={1.11,'eV'},TIKF={0,'K^-1'},TRS1={0,'K^-1'},TRS2={0,'K^-2'},TBV1={0,'K^-1'}, ...
TBV2={0,'K^-2'});
D3 = ee.additional.spice_semiconductors.spice_diode(AREA={1,'m^2'},SCALE={1,'1'},IS={1e-15,'A/m^2'},IKF={Inf,'A/m^2'}, ...
ISR={0,'A/m^2'},N={1,'1'},NR={2,'1'},M={0.5,'1'},VJ={1,'V'},RS={1e-12,'Ohm*m^2'},C_param={2,'1'},CJO={0,'F/m^2'}, ...
FC={0.5,'1'},TT={0,'s'},RevBrk={2,'1'},BV={Inf,'V'},IBV={1e-10,'A/m^2'},IBVL={1e-10,'A/m^2'},NBV={1,'1'}, ...
NBVL={1,'1'},XTI={3,'1'},EG={1.11,'eV'},TIKF={0,'K^-1'},TRS1={0,'K^-1'},TRS2={0,'K^-2'},TBV1={0,'K^-1'}, ...
TBV2={0,'K^-2'});
R2 = foundation.electrical.elements.resistor(R={1e+009,'Ohm'});
R3 = foundation.electrical.elements.resistor(R={1e+009,'Ohm'});
RG = foundation.electrical.elements.resistor(R={1.6,'Ohm'});
end
connections
connect(M0.dx,node_1);
connect(M0.gx,node_22);
connect(M0.sx,node_3);
connect(M0.bx,node_3);
connect(D0.p,node_3);
connect(D0.n,node_1);
connect(D1.p,node_3);
connect(D1.n,node_1);
connect(D2.p,node_2);
connect(D2.n,node_10);
connect(D3.p,node_3);
connect(D3.n,node_10);
connect(R2.p,node_10);
connect(R2.n,node_2);
connect(R3.p,node_10);
connect(R3.n,node_3);
connect(RG.p,node_2);
connect(RG.n,node_22);
end
end
Kindly help me for the same.