更新SourceData
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
PROJECT_FILE F:\codex_proj\LEM_Simulink\LinearSimulink.aedt
|
||||
PROJECT_EXISTS True
|
||||
OPEN_PROJECT_RETURN IDispatch(ISProject2)
|
||||
ACTIVE_PROJECT LinearSimulink
|
||||
TOP_DESIGNS ['78;Simplorer1', '73;LinearSimulink1_ckt', 'ECE', '87;Simplorer2', 'NS']
|
||||
ACTIVE_DESIGN 87;Simplorer2
|
||||
DESIGN_TYPE Twin Builder
|
||||
SETUPS_ERROR AttributeError("'ADispatchWrapper' object has no attribute 'GetSetups'",)
|
||||
EDITOR IDispatch(ISSchematicScript)
|
||||
ALL_ELEMENTS ['GPort@0;12', 'GPort@0;224', 'GPort@0;642', 'PagePort@P1;737', 'PagePort@P2;742', 'PagePort@P3;747', 'PagePort@P4;752', 'PagePort@P5;757', 'PagePort@P6;762', 'PagePort@ia;767', 'PagePort@ib;772', 'PagePort@ic;777', 'PagePort@Fe;782', 'PagePort@FL;787', 'PagePort@THM;792', 'PagePort@v;797', 'PagePort@ia;1820', 'PagePort@ib;1825', 'PagePort@ic;1830', 'PagePort@v;1835', 'PagePort@THM;1840', 'PagePort@Fe;1845', 'PagePort@FL;1850', 'PagePort@P6;1854', 'PagePort@P5;1858', 'PagePort@P4;1862', 'PagePort@P3;1866', 'PagePort@P2;1870', 'PagePort@P1;1874', 'CompInst@MaxwellECEData3;79;1', 'CompInst@L;88;34', 'CompInst@L;89;36', 'CompInst@L;90;38', 'CompInst@R;91;40', 'CompInst@R;92;42', 'CompInst@R;93;44', 'CompInst@D;94;46', 'CompInst@D;95;48', 'CompInst@D;96;50', 'CompInst@D;97;52', 'CompInst@D;98;54', 'CompInst@D;99;56', 'CompInst@IGBT;100;58', 'CompInst@IGBT;101;60', 'CompInst@IGBT;102;62', 'CompInst@IGBT;103;64', 'CompInst@IGBT;104;66', 'CompInst@IGBT;105;68', 'CompInst@AM;106;105', 'CompInst@AM;107;107', 'CompInst@AM;108;109', 'CompInst@E;109;114', 'CompInst@FM_TRB;110;562', 'CompInst@SM_TRB;111;564', 'CompInst@VM_TRB;112;568', 'CompInst@F_TRB;113;572', 'CompInst@MASS_TRB;114;574', 'CompInst@SimulinkData2;116;1817', 'Wire@net_1;146', 'Wire@0;13', 'Wire@net_7;216', 'Wire@net_9;477', 'Wire@0;228', 'Wire@net_18;521', 'Wire@net_19;527', 'Wire@net_20;533', 'Wire@net_21;539', 'Wire@net_22;545', 'Wire@net_23;551', 'Wire@net_24;624', 'Wire@net_25;630', 'Wire@0;643', 'Wire@P1;738', 'Wire@P2;743', 'Wire@P3;748', 'Wire@P4;753', 'Wire@P5;758', 'Wire@P6;763', 'Wire@ia;768', 'Wire@ib;773', 'Wire@ic;778', 'Wire@Fe;783', 'Wire@FL;788', 'Wire@THM;793', 'Wire@v;798', 'Wire@net_27;1667', 'Wire@net_28;1683', 'Wire@net_29;1691', 'Wire@net_30;1701', 'Wire@net_31;1731', 'Wire@ia;1821', 'Wire@ib;1826', 'Wire@ic;1831', 'Wire@v;1836', 'Wire@THM;1841', 'Wire@Fe;1846', 'Wire@FL;1851', 'Wire@P6;1855', 'Wire@P5;1859', 'Wire@P4;1863', 'Wire@P3;1867', 'Wire@P2;1871', 'Wire@P1;1875']
|
||||
MESSAGES []
|
||||
PROBE_STATUS PASS
|
||||
@@ -0,0 +1,7 @@
|
||||
错误使用 probe_ansoft_integration (第 41 行)
|
||||
'PMLSM/S-Function' 中的 S-Function 'AnsoftSFunction' 报告错误:
|
||||
���
|
||||
|
||||
出错 run (第 112 行)
|
||||
evalin('caller', strcat(scriptStem, ';'));
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Binary file not shown.
@@ -0,0 +1,55 @@
|
||||
MODEL Clark
|
||||
STATUS FAIL
|
||||
ERROR_ID Simulink:Engine:DefaultDimsMightHaveCausedError
|
||||
ERROR 错误使用 inspect_lem_models (第 111 行)
|
||||
尝试解析欠定信号维度时,模型 'Clark' 的编译失败。
|
||||
Suggested Actions:
|
||||
• 为欠定信号维度列表启用 '警告' 或 '错误' 诊断。 - Open
|
||||
原因:
|
||||
错误使用 Simulink.Simulation.internal.DesktopSimHelper
|
||||
由于模块体中的错误或基础分析的限制,Simulink 无法确定模块 <a href="matlab:sfprivate('sfOpenObjectBySId','Clark:16')">'Clark/Anti_Clark/c'</a> 的输出大小和/或类型。错误可能不准确。请修复指示的错
|
||||
误,或显式指定所有模块输出的大小和/或类型。
|
||||
|
||||
|
||||
|
||||
出错 Simulink.Simulation.internal.DesktopSimHelper.sim
|
||||
|
||||
出错 Simulink.SimulationInput/sim
|
||||
|
||||
出错 inspect_lem_models (第 111 行)
|
||||
out = sim(in);
|
||||
^^^^^^^^^^^^^^
|
||||
错误使用 Simulink.Simulation.internal.DesktopSimHelper
|
||||
端口宽度或维度出错。'Clark/Anti_Clark/c/Beta' 的'输出端口 1' 是有 1 个元素的一维向量。
|
||||
|
||||
出错 Simulink.Simulation.internal.DesktopSimHelper.sim
|
||||
|
||||
出错 Simulink.SimulationInput/sim
|
||||
|
||||
出错 inspect_lem_models (第 111 行)
|
||||
out = sim(in);
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
MODEL PMLSM
|
||||
STATUS FAIL
|
||||
ERROR_ID Simulink:Engine:SFcnDoesNotExist
|
||||
ERROR 错误使用 inspect_lem_models (第 111 行)
|
||||
S-Function 'PMLSM/S-Function' 中出错: S-Function 'AnsoftSFunction' 不存在
|
||||
|
||||
MODEL PMLSM_ThreeNodeThermal
|
||||
STATUS FAIL
|
||||
ERROR_ID Simulink:Parameters:InvParamSetting
|
||||
ERROR 错误使用 inspect_lem_models (第 111 行)
|
||||
参数 'Gain' 的 'PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/dT_i_dt_1_over_Ci' 中的设置无效。
|
||||
原因:
|
||||
错误使用 Simulink.Simulation.internal.DesktopSimHelper
|
||||
The parameter supports only finite values.
|
||||
|
||||
出错 Simulink.Simulation.internal.DesktopSimHelper.sim
|
||||
|
||||
出错 Simulink.SimulationInput/sim
|
||||
|
||||
出错 inspect_lem_models (第 111 行)
|
||||
out = sim(in);
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
$begin 'ConnectionParameters'
|
||||
DesktopProcessID=29380
|
||||
DesktopProcessPath='F:\\Program Files\\ANSYS Inc\\v252\\AnsysEM\\ansysedt.exe'
|
||||
LaunchedByWB=false
|
||||
GRPCPort=0
|
||||
$begin 'DesktopStubBlock'
|
||||
$begin 'CommDetails'
|
||||
TransportType=1
|
||||
IPAddress='192.168.81.1'
|
||||
ListenPort='21505'
|
||||
IPAddressVector[2: '192.168.10.1', '192.168.2.36']
|
||||
$end 'CommDetails'
|
||||
$begin 'Marshall'
|
||||
InstanceID=503
|
||||
ProcID=29380
|
||||
InterfaceID=1
|
||||
FactoryIntID='DesktopInterfaceForWBProxyStubFactory'
|
||||
$end 'Marshall'
|
||||
$end 'DesktopStubBlock'
|
||||
$begin 'DesktopBackgroundObjStubBlock'
|
||||
$begin 'CommDetails'
|
||||
TransportType=1
|
||||
IPAddress='192.168.81.1'
|
||||
ListenPort='21505'
|
||||
IPAddressVector[2: '192.168.10.1', '192.168.2.36']
|
||||
$end 'CommDetails'
|
||||
$begin 'Marshall'
|
||||
InstanceID=505
|
||||
ProcID=29380
|
||||
InterfaceID=2
|
||||
FactoryIntID='DesktopInterfaceForWBProxyStubFactory'
|
||||
$end 'Marshall'
|
||||
$end 'DesktopBackgroundObjStubBlock'
|
||||
$end 'ConnectionParameters'
|
||||
@@ -0,0 +1,34 @@
|
||||
$begin 'ConnectionParameters'
|
||||
DesktopProcessID=30488
|
||||
DesktopProcessPath='F:\\Program Files\\ANSYS Inc\\v252\\AnsysEM\\ansysedt.exe'
|
||||
LaunchedByWB=false
|
||||
GRPCPort=0
|
||||
$begin 'DesktopStubBlock'
|
||||
$begin 'CommDetails'
|
||||
TransportType=1
|
||||
IPAddress='192.168.81.1'
|
||||
ListenPort='40162'
|
||||
IPAddressVector[2: '192.168.10.1', '192.168.2.36']
|
||||
$end 'CommDetails'
|
||||
$begin 'Marshall'
|
||||
InstanceID=503
|
||||
ProcID=30488
|
||||
InterfaceID=1
|
||||
FactoryIntID='DesktopInterfaceForWBProxyStubFactory'
|
||||
$end 'Marshall'
|
||||
$end 'DesktopStubBlock'
|
||||
$begin 'DesktopBackgroundObjStubBlock'
|
||||
$begin 'CommDetails'
|
||||
TransportType=1
|
||||
IPAddress='192.168.81.1'
|
||||
ListenPort='40162'
|
||||
IPAddressVector[2: '192.168.10.1', '192.168.2.36']
|
||||
$end 'CommDetails'
|
||||
$begin 'Marshall'
|
||||
InstanceID=505
|
||||
ProcID=30488
|
||||
InterfaceID=2
|
||||
FactoryIntID='DesktopInterfaceForWBProxyStubFactory'
|
||||
$end 'Marshall'
|
||||
$end 'DesktopBackgroundObjStubBlock'
|
||||
$end 'ConnectionParameters'
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
$begin 'ConnectionParameters'
|
||||
DesktopProcessID=38488
|
||||
DesktopProcessPath='F:\\Program Files\\ANSYS Inc\\v252\\AnsysEM\\ansysedt.exe'
|
||||
LaunchedByWB=false
|
||||
GRPCPort=0
|
||||
$begin 'DesktopStubBlock'
|
||||
$begin 'CommDetails'
|
||||
TransportType=1
|
||||
IPAddress='192.168.81.1'
|
||||
ListenPort='44845'
|
||||
IPAddressVector[2: '192.168.10.1', '192.168.2.36']
|
||||
$end 'CommDetails'
|
||||
$begin 'Marshall'
|
||||
InstanceID=503
|
||||
ProcID=38488
|
||||
InterfaceID=1
|
||||
FactoryIntID='DesktopInterfaceForWBProxyStubFactory'
|
||||
$end 'Marshall'
|
||||
$end 'DesktopStubBlock'
|
||||
$begin 'DesktopBackgroundObjStubBlock'
|
||||
$begin 'CommDetails'
|
||||
TransportType=1
|
||||
IPAddress='192.168.81.1'
|
||||
ListenPort='44845'
|
||||
IPAddressVector[2: '192.168.10.1', '192.168.2.36']
|
||||
$end 'CommDetails'
|
||||
$begin 'Marshall'
|
||||
InstanceID=505
|
||||
ProcID=38488
|
||||
InterfaceID=2
|
||||
FactoryIntID='DesktopInterfaceForWBProxyStubFactory'
|
||||
$end 'Marshall'
|
||||
$end 'DesktopBackgroundObjStubBlock'
|
||||
$end 'ConnectionParameters'
|
||||
@@ -0,0 +1,258 @@
|
||||
=== MODEL PMLSM ===
|
||||
CALLBACK PreLoadFcn
|
||||
CALLBACK PostLoadFcn
|
||||
CALLBACK InitFcn
|
||||
CALLBACK StartFcn
|
||||
CALLBACK StopFcn
|
||||
CALLBACK CloseFcn
|
||||
DATA_DICTIONARY
|
||||
ROOT_BLOCKS
|
||||
PMLSM/Add Sum
|
||||
PMLSM/Anti_Park SubSystem
|
||||
PMLSM/Constant Constant
|
||||
PMLSM/Constant1 Constant
|
||||
PMLSM/Delay Delay
|
||||
PMLSM/Delay1 Delay
|
||||
PMLSM/Delay2 Delay
|
||||
PMLSM/Delay3 Delay
|
||||
PMLSM/Delay4 Delay
|
||||
PMLSM/Delay5 Delay
|
||||
PMLSM/Demux Demux
|
||||
PMLSM/Demux1 Demux
|
||||
PMLSM/FL_generater SubSystem
|
||||
PMLSM/Fe Scope
|
||||
PMLSM/Gain Gain
|
||||
PMLSM/Mux Mux
|
||||
PMLSM/Mux1 Mux
|
||||
PMLSM/Mux2 Mux
|
||||
PMLSM/PID Controller SubSystem PID 1dof
|
||||
PMLSM/PID Controller1 SubSystem PID 1dof
|
||||
PMLSM/PID Controller2 SubSystem PID 1dof
|
||||
PMLSM/Park(abc_dq) SubSystem
|
||||
PMLSM/S-Function S-Function
|
||||
PMLSM/SVPWM Generator
|
||||
(2-Level) SubSystem SVPWM Generator (2-Level)
|
||||
PMLSM/Sum Sum
|
||||
PMLSM/Sum1 Sum
|
||||
PMLSM/Sum2 Sum
|
||||
PMLSM/Transfer Fcn TransferFcn
|
||||
PMLSM/Transfer Fcn1 TransferFcn
|
||||
PMLSM/iabc Scope
|
||||
PMLSM/id Scope
|
||||
PMLSM/iq Scope
|
||||
PMLSM/iq_compare Scope
|
||||
PMLSM/iq_error Scope
|
||||
PMLSM/position_init Constant
|
||||
PMLSM/powergui SubSystem PSB option menu block
|
||||
PMLSM/v Scope
|
||||
PMLSM/v_compare Scope
|
||||
PMLSM/v_error Scope
|
||||
PORT_MAP PMLSM
|
||||
PMLSM PMLSM/Demux:1 -> PMLSM/Park(abc_dq):1
|
||||
PMLSM PMLSM/Demux:2 -> PMLSM/Park(abc_dq):2
|
||||
PMLSM PMLSM/Demux:3 -> PMLSM/Park(abc_dq):3
|
||||
PMLSM PMLSM/Mux:1 -> PMLSM/iabc:1
|
||||
PMLSM PMLSM/Mux:1 -> PMLSM/Delay4:1
|
||||
PMLSM PMLSM/Mux:1 -> PMLSM/iabc:1
|
||||
PMLSM PMLSM/Mux:1 -> PMLSM/Delay4:1
|
||||
PMLSM PMLSM/S-Function:5 -> PMLSM/Add:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay3:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Mux2:2
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/v:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay3:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Mux2:2
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay3:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Mux2:2
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay3:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Mux2:2
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/Delay:1
|
||||
PMLSM PMLSM/S-Function:4 -> PMLSM/v:1
|
||||
PMLSM PMLSM/S-Function:6 -> PMLSM/Fe:1
|
||||
PMLSM PMLSM/Sum:1 -> PMLSM/v_error:1
|
||||
PMLSM PMLSM/Sum:1 -> PMLSM/PID Controller2:1
|
||||
PMLSM PMLSM/Sum:1 -> PMLSM/v_error:1
|
||||
PMLSM PMLSM/Sum:1 -> PMLSM/PID Controller2:1
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/Mux1:2
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/Delay2:1
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/iq:1
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/Mux1:2
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/Delay2:1
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/iq:1
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/Delay2:1
|
||||
PMLSM PMLSM/Park(abc_dq):2 -> PMLSM/iq:1
|
||||
PMLSM PMLSM/Sum1:1 -> PMLSM/iq_error:1
|
||||
PMLSM PMLSM/Sum1:1 -> PMLSM/PID Controller:1
|
||||
PMLSM PMLSM/Sum1:1 -> PMLSM/iq_error:1
|
||||
PMLSM PMLSM/Sum1:1 -> PMLSM/PID Controller:1
|
||||
PMLSM PMLSM/Sum2:1 -> PMLSM/PID Controller1:1
|
||||
PMLSM PMLSM/Constant1:1 -> PMLSM/Sum2:1
|
||||
PMLSM PMLSM/PID Controller:1 -> PMLSM/Anti_Park:2
|
||||
PMLSM PMLSM/PID Controller1:1 -> PMLSM/Anti_Park:1
|
||||
PMLSM PMLSM/Anti_Park:1 -> PMLSM/SVPWM Generator
|
||||
(2-Level):1
|
||||
PMLSM PMLSM/Anti_Park:2 -> PMLSM/SVPWM Generator
|
||||
(2-Level):2
|
||||
PMLSM PMLSM/Park(abc_dq):1 -> PMLSM/Delay1:1
|
||||
PMLSM PMLSM/Park(abc_dq):1 -> PMLSM/id:1
|
||||
PMLSM PMLSM/Park(abc_dq):1 -> PMLSM/Delay1:1
|
||||
PMLSM PMLSM/Park(abc_dq):1 -> PMLSM/id:1
|
||||
PMLSM PMLSM/SVPWM Generator
|
||||
(2-Level):1 -> PMLSM/Demux1:1
|
||||
PMLSM PMLSM/Demux1:1 -> PMLSM/S-Function:1
|
||||
PMLSM PMLSM/Demux1:2 -> PMLSM/S-Function:2
|
||||
PMLSM PMLSM/Demux1:3 -> PMLSM/S-Function:3
|
||||
PMLSM PMLSM/Demux1:4 -> PMLSM/S-Function:4
|
||||
PMLSM PMLSM/Demux1:5 -> PMLSM/S-Function:5
|
||||
PMLSM PMLSM/Demux1:6 -> PMLSM/S-Function:6
|
||||
PMLSM PMLSM/FL_generater:1 -> PMLSM/S-Function:7
|
||||
PMLSM PMLSM/S-Function:1 -> PMLSM/Mux:1
|
||||
PMLSM PMLSM/S-Function:2 -> PMLSM/Mux:2
|
||||
PMLSM PMLSM/S-Function:3 -> PMLSM/Mux:3
|
||||
PMLSM PMLSM/Gain:1 -> PMLSM/Delay5:1
|
||||
PMLSM PMLSM/Gain:1 -> PMLSM/Park(abc_dq):4
|
||||
PMLSM PMLSM/Gain:1 -> PMLSM/Delay5:1
|
||||
PMLSM PMLSM/Gain:1 -> PMLSM/Park(abc_dq):4
|
||||
PMLSM PMLSM/Delay:1 -> PMLSM/FL_generater:1
|
||||
PMLSM PMLSM/Delay1:1 -> PMLSM/Sum2:2
|
||||
PMLSM PMLSM/Delay2:1 -> PMLSM/Transfer Fcn1:1
|
||||
PMLSM PMLSM/Delay4:1 -> PMLSM/Demux:1
|
||||
PMLSM PMLSM/Delay5:1 -> PMLSM/Anti_Park:3
|
||||
PMLSM PMLSM/Add:1 -> PMLSM/Gain:1
|
||||
PMLSM PMLSM/position_init:1 -> PMLSM/Add:2
|
||||
PMLSM PMLSM/Constant:1 -> PMLSM/Sum:1
|
||||
PMLSM PMLSM/Constant:1 -> PMLSM/Mux2:1
|
||||
PMLSM PMLSM/Constant:1 -> PMLSM/Sum:1
|
||||
PMLSM PMLSM/Constant:1 -> PMLSM/Mux2:1
|
||||
PMLSM PMLSM/Delay3:1 -> PMLSM/Transfer Fcn:1
|
||||
PMLSM PMLSM/PID Controller2:1 -> PMLSM/Mux1:1
|
||||
PMLSM PMLSM/PID Controller2:1 -> PMLSM/Sum1:1
|
||||
PMLSM PMLSM/PID Controller2:1 -> PMLSM/Mux1:1
|
||||
PMLSM PMLSM/PID Controller2:1 -> PMLSM/Sum1:1
|
||||
PMLSM PMLSM/Transfer Fcn:1 -> PMLSM/Mux2:3
|
||||
PMLSM PMLSM/Transfer Fcn:1 -> PMLSM/Sum:2
|
||||
PMLSM PMLSM/Transfer Fcn:1 -> PMLSM/Mux2:3
|
||||
PMLSM PMLSM/Transfer Fcn:1 -> PMLSM/Sum:2
|
||||
PMLSM PMLSM/Mux1:1 -> PMLSM/iq_compare:1
|
||||
PMLSM PMLSM/Transfer Fcn1:1 -> PMLSM/Sum1:2
|
||||
PMLSM PMLSM/Transfer Fcn1:1 -> PMLSM/Mux1:3
|
||||
PMLSM PMLSM/Transfer Fcn1:1 -> PMLSM/Sum1:2
|
||||
PMLSM PMLSM/Transfer Fcn1:1 -> PMLSM/Mux1:3
|
||||
PMLSM PMLSM/Mux2:1 -> PMLSM/v_compare:1
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/The:1 -> PMLSM/Anti_Park/beta:3
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/The:1 -> PMLSM/Anti_Park/alpha:3
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/The:1 -> PMLSM/Anti_Park/beta:3
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/The:1 -> PMLSM/Anti_Park/alpha:3
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/D:1 -> PMLSM/Anti_Park/alpha:1
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/D:1 -> PMLSM/Anti_Park/beta:1
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/D:1 -> PMLSM/Anti_Park/alpha:1
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/D:1 -> PMLSM/Anti_Park/beta:1
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/Q:1 -> PMLSM/Anti_Park/beta:2
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/Q:1 -> PMLSM/Anti_Park/alpha:2
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/Q:1 -> PMLSM/Anti_Park/beta:2
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/Q:1 -> PMLSM/Anti_Park/alpha:2
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/alpha:1 -> PMLSM/Anti_Park/Alpha:1
|
||||
PMLSM/Anti_Park PMLSM/Anti_Park/beta:1 -> PMLSM/Anti_Park/Beta:1
|
||||
PMLSM/FL_generater PMLSM/FL_generater/v:1 -> PMLSM/FL_generater/Gain:1
|
||||
PMLSM/FL_generater PMLSM/FL_generater/Step:1 -> PMLSM/FL_generater/Add:2
|
||||
PMLSM/FL_generater PMLSM/FL_generater/Add:1 -> PMLSM/FL_generater/Gain1:1
|
||||
PMLSM/FL_generater PMLSM/FL_generater/Gain1:1 -> PMLSM/FL_generater/FL:1
|
||||
PMLSM/FL_generater PMLSM/FL_generater/Gain:1 -> PMLSM/FL_generater/Add:1
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/Park_Q:1 -> PMLSM/Park(abc_dq)/Q:1
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/The:1 -> PMLSM/Park(abc_dq)/Park_Q:4
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/The:1 -> PMLSM/Park(abc_dq)/Park_D:4
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/The:1 -> PMLSM/Park(abc_dq)/Park_Q:4
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/The:1 -> PMLSM/Park(abc_dq)/Park_D:4
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/C:1 -> PMLSM/Park(abc_dq)/Park_Q:3
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/C:1 -> PMLSM/Park(abc_dq)/Park_D:3
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/C:1 -> PMLSM/Park(abc_dq)/Park_Q:3
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/C:1 -> PMLSM/Park(abc_dq)/Park_D:3
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/A:1 -> PMLSM/Park(abc_dq)/Park_Q:1
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/A:1 -> PMLSM/Park(abc_dq)/Park_D:1
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/A:1 -> PMLSM/Park(abc_dq)/Park_Q:1
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/A:1 -> PMLSM/Park(abc_dq)/Park_D:1
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/B:1 -> PMLSM/Park(abc_dq)/Park_Q:2
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/B:1 -> PMLSM/Park(abc_dq)/Park_D:2
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/B:1 -> PMLSM/Park(abc_dq)/Park_Q:2
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/B:1 -> PMLSM/Park(abc_dq)/Park_D:2
|
||||
PMLSM/Park(abc_dq) PMLSM/Park(abc_dq)/Park_D:1 -> PMLSM/Park(abc_dq)/D:1
|
||||
|
||||
=== MODEL PMLSM_ThreeNodeThermal ===
|
||||
CALLBACK PreLoadFcn
|
||||
CALLBACK PostLoadFcn
|
||||
CALLBACK InitFcn
|
||||
CALLBACK StartFcn
|
||||
CALLBACK StopFcn
|
||||
CALLBACK CloseFcn
|
||||
DATA_DICTIONARY
|
||||
ROOT_BLOCKS
|
||||
PMLSM_ThreeNodeThermal/Pcu SubSystem
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal SubSystem
|
||||
PORT_MAP PMLSM_ThreeNodeThermal
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_mover_degC:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_im:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/From1:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_im:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_degC:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Goto:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_ma1:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_degC:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Goto:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_ma1:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Goto:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_ma1:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/P_fe_W:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Net_heat_iron1:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im_G_im:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im_G_im:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Net_heat_iron1:3
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im_G_im:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im_G_im:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Net_heat_iron1:3
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_ma1:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_ia_G_ia:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_im:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im_G_im:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/dT_i_dt_1_over_Ci:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_iron_state:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/T_amb_degC:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Delta_T_ma1:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_ia_G_ia:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Net_heat_iron1:4
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Net_heat_iron1:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/dT_i_dt_1_over_Ci:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_wi:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/Net_heat_iron1:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Net_heat_mover:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/dT_m_dt_1_over_Cm:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Delta_T_ma:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_degC:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Delta_T_ma:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_degC:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/P_eddy_W:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Net_heat_mover:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/dT_m_dt_1_over_Cm:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_mover_state:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Delta_T_ma:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/q_ma_G_ma:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/q_ma_G_ma:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Net_heat_mover:3
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/q_im:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Net_heat_mover:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/T_amb_degC:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/Delta_T_ma:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/From5:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wa_G_wa:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/From3:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Net_heat_winding:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi_G_wi:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Goto2:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi_G_wi:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi_G_wi:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Goto2:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi_G_wi:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_degC:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wi:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wa:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_degC:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wi:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wa:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wi:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wa:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/dT_w_dt_1_over_Cw:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_winding_state:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/P_cu_W:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Net_heat_winding:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wa:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Goto3:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Net_heat_winding:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/dT_w_dt_1_over_Cw:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wa_G_wa:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Net_heat_winding:3
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wi:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi_G_wi:1
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_amb_degC:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wa:2
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/T_iron_degC:1 -> PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/Delta_T_wi:2
|
||||
RESOLVED_GAINS
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/dT_i_dt_1_over_Ci 1/C_i slResolve=Inf modelWorkspace=0.000833333333333333
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_ia_G_ia 1/R_ia slResolve=Inf modelWorkspace=0.833333333333333
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/iron_node/q_im_G_im 1/R_im slResolve=Inf modelWorkspace=1.25
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/dT_m_dt_1_over_Cm 1/C_m slResolve=Inf modelWorkspace=0.00125
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/mover_node/q_ma_G_ma 1/R_ma slResolve=Inf modelWorkspace=0.666666666666667
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/dT_w_dt_1_over_Cw 1/C_w slResolve=Inf modelWorkspace=0.00285714285714286
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wa_G_wa 1/R_wa slResolve=Inf modelWorkspace=0.5
|
||||
PMLSM_ThreeNodeThermal/ThreeNodeThermal/wind_node/q_wi_G_wi 1/R_wi slResolve=Inf modelWorkspace=2.85714285714286
|
||||
RESOLVED_PCU_CONSTANTS
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
function apply_pmlsm_ansys_integration
|
||||
% Persist the validated PMLSM-to-AEDT link and automatic interface setup.
|
||||
|
||||
projectDir = fileparts(mfilename('fullpath'));
|
||||
modelFile = fullfile(projectDir, 'LEM_slx', 'PMLSM.slx');
|
||||
projectFile = fullfile(projectDir, 'LinearSimulink.aedt');
|
||||
backupDir = fullfile(projectDir, 'analysis_artifacts', 'backups');
|
||||
backupFile = fullfile(backupDir, 'PMLSM_before_ansys_relink.slx');
|
||||
|
||||
assert(isfile(modelFile), 'PMLSM model not found: %s', modelFile);
|
||||
assert(isfile(projectFile), 'AEDT project not found: %s', projectFile);
|
||||
if ~isfolder(backupDir)
|
||||
mkdir(backupDir);
|
||||
end
|
||||
|
||||
load_system(modelFile);
|
||||
closeOriginal = onCleanup(@() close_system('PMLSM', 0));
|
||||
|
||||
if ~isfile(backupFile)
|
||||
save_system('PMLSM', backupFile);
|
||||
close_system('PMLSM', 0);
|
||||
load_system(modelFile);
|
||||
end
|
||||
|
||||
blockPath = 'PMLSM/S-Function';
|
||||
userData = get_param(blockPath, 'UserData');
|
||||
fields = strsplit(userData, ',');
|
||||
assert(numel(fields) >= 6 && strcmp(fields{1}, 'DataVer:2'), ...
|
||||
'Unexpected Ansoft S-Function UserData format.');
|
||||
fields{2} = projectFile;
|
||||
fields{3} = 'LinearSimulink';
|
||||
fields{4} = 'Simplorer2';
|
||||
fields{5} = 'TR';
|
||||
fields{6} = 'MDL1';
|
||||
updatedUserData = strjoin(fields, ',');
|
||||
|
||||
set_param(blockPath, ...
|
||||
'FunctionName', 'AnsoftSFunction', ...
|
||||
'Parameters', '-1', ...
|
||||
'UserData', updatedUserData, ...
|
||||
'UserDataPersistent', 'on', ...
|
||||
'OpenFcn', 'AnsoftLinkDialog();');
|
||||
|
||||
initCallback = [ ...
|
||||
'run(fullfile(fileparts(get_param(bdroot,''FileName'')),' ...
|
||||
'''setup_lem_ansys_link.m''));'];
|
||||
set_param('PMLSM', 'InitFcn', initCallback);
|
||||
save_system('PMLSM', modelFile);
|
||||
|
||||
fprintf('UPDATED_MODEL\t%s\n', modelFile);
|
||||
fprintf('BACKUP_MODEL\t%s\n', backupFile);
|
||||
fprintf('PROJECT_LINK\t%s\n', fields{2});
|
||||
fprintf('INIT_FCN\t%s\n', get_param('PMLSM', 'InitFcn'));
|
||||
end
|
||||
@@ -0,0 +1,142 @@
|
||||
function inspect_lem_models
|
||||
% Read-only structural inventory and compile probe for the LEM Simulink models.
|
||||
|
||||
rootDir = fileparts(mfilename('fullpath'));
|
||||
modelDir = fullfile(rootDir, 'LEM_slx');
|
||||
reportDir = fullfile(rootDir, 'analysis_artifacts');
|
||||
if ~exist(reportDir, 'dir')
|
||||
mkdir(reportDir);
|
||||
end
|
||||
|
||||
models = {'Clark', 'PMLSM', 'PMLSM_ThreeNodeThermal'};
|
||||
addpath(modelDir);
|
||||
for k = 1:numel(models)
|
||||
model = models{k};
|
||||
modelFile = fullfile(modelDir, [model '.slx']);
|
||||
reportFile = fullfile(reportDir, [model '_inventory.txt']);
|
||||
fid = fopen(reportFile, 'w');
|
||||
cleanup = onCleanup(@() fclose(fid));
|
||||
|
||||
fprintf(fid, 'MODEL\t%s\nFILE\t%s\n', model, modelFile);
|
||||
load_system(modelFile);
|
||||
fprintf(fid, 'MODEL_VERSION\t%s\n', get_param(model, 'ModelVersion'));
|
||||
fprintf(fid, 'SOLVER\t%s\n', get_param(model, 'Solver'));
|
||||
fprintf(fid, 'SOLVER_TYPE\t%s\n', get_param(model, 'SolverType'));
|
||||
fprintf(fid, 'FIXED_STEP\t%s\n', get_param(model, 'FixedStep'));
|
||||
fprintf(fid, 'START_TIME\t%s\n', get_param(model, 'StartTime'));
|
||||
fprintf(fid, 'STOP_TIME\t%s\n', get_param(model, 'StopTime'));
|
||||
fprintf(fid, 'SAMPLE_TIME_COLORS\t%s\n', get_param(model, 'SampleTimeColors'));
|
||||
|
||||
refs = find_mdlrefs(model, 'MatchFilter', @Simulink.match.internal.filterOutCodeInactiveVariantSubsystemChoices);
|
||||
fprintf(fid, 'MODEL_REFERENCES\t%s\n', strjoin(refs, ', '));
|
||||
|
||||
fprintf(fid, '\nMODEL_WORKSPACE\n');
|
||||
ws = get_param(model, 'ModelWorkspace');
|
||||
vars = ws.whos;
|
||||
for n = 1:numel(vars)
|
||||
value = ws.getVariable(vars(n).name);
|
||||
fprintf(fid, '%s\t%s\t%s\n', vars(n).name, vars(n).class, valueText(value));
|
||||
end
|
||||
|
||||
fprintf(fid, '\nBLOCKS_AND_PARAMETERS\n');
|
||||
blocks = find_system(model, 'LookUnderMasks', 'all', 'FollowLinks', 'off', ...
|
||||
'MatchFilter', @Simulink.match.allVariants, 'Type', 'Block');
|
||||
for n = 1:numel(blocks)
|
||||
block = blocks{n};
|
||||
fprintf(fid, '\nBLOCK\t%s\n', block);
|
||||
fprintf(fid, 'SID\t%s\n', Simulink.ID.getSID(block));
|
||||
fprintf(fid, 'TYPE\t%s\n', get_param(block, 'BlockType'));
|
||||
fprintf(fid, 'MASK_TYPE\t%s\n', get_param(block, 'MaskType'));
|
||||
fprintf(fid, 'REFERENCE\t%s\n', get_param(block, 'ReferenceBlock'));
|
||||
params = get_param(block, 'DialogParameters');
|
||||
if isstruct(params)
|
||||
names = fieldnames(params);
|
||||
for p = 1:numel(names)
|
||||
name = names{p};
|
||||
try
|
||||
value = get_param(block, name);
|
||||
fprintf(fid, 'PARAM\t%s\t%s\n', name, valueText(value));
|
||||
catch
|
||||
end
|
||||
end
|
||||
end
|
||||
if strcmp(get_param(block, 'BlockType'), 'SubSystem')
|
||||
try
|
||||
script = get_param(block, 'Script');
|
||||
if ~isempty(script)
|
||||
fprintf(fid, 'SCRIPT_BEGIN\n%s\nSCRIPT_END\n', script);
|
||||
end
|
||||
catch
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
fprintf(fid, '\nLINES\n');
|
||||
systems = [{model}; find_system(model, 'LookUnderMasks', 'all', ...
|
||||
'FollowLinks', 'off', 'MatchFilter', @Simulink.match.allVariants, ...
|
||||
'BlockType', 'SubSystem')];
|
||||
systems = unique(systems, 'stable');
|
||||
for n = 1:numel(systems)
|
||||
lines = find_system(systems{n}, 'FindAll', 'on', 'SearchDepth', 1, 'Type', 'Line');
|
||||
for p = 1:numel(lines)
|
||||
src = get_param(lines(p), 'SrcBlockHandle');
|
||||
dst = get_param(lines(p), 'DstBlockHandle');
|
||||
if src > 0 && ~isempty(dst)
|
||||
for q = 1:numel(dst)
|
||||
if dst(q) > 0
|
||||
fprintf(fid, '%s\t%s -> %s\n', systems{n}, ...
|
||||
getfullname(src), getfullname(dst(q)));
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
clear cleanup
|
||||
close_system(model, 0);
|
||||
end
|
||||
|
||||
compileFile = fullfile(reportDir, 'compile_probe.txt');
|
||||
fid = fopen(compileFile, 'w');
|
||||
cleanup = onCleanup(@() fclose(fid));
|
||||
for k = 1:numel(models)
|
||||
model = models{k};
|
||||
modelFile = fullfile(modelDir, [model '.slx']);
|
||||
fprintf(fid, 'MODEL\t%s\n', model);
|
||||
try
|
||||
in = Simulink.SimulationInput(model);
|
||||
in = in.setModelParameter('StopTime', '0');
|
||||
in = in.setModelParameter('SimulationMode', 'normal');
|
||||
in = in.setPreSimFcn(@(~) addpath(modelDir));
|
||||
out = sim(in);
|
||||
fprintf(fid, 'STATUS\tPASS\n');
|
||||
fprintf(fid, 'OUTPUTS\t%s\n', strjoin(who(out), ', '));
|
||||
catch ME
|
||||
fprintf(fid, 'STATUS\tFAIL\n');
|
||||
fprintf(fid, 'ERROR_ID\t%s\n', ME.identifier);
|
||||
fprintf(fid, 'ERROR\t%s\n', getReport(ME, 'extended', 'hyperlinks', 'off'));
|
||||
end
|
||||
fprintf(fid, '\n');
|
||||
end
|
||||
clear cleanup
|
||||
end
|
||||
|
||||
function text = valueText(value)
|
||||
if ischar(value)
|
||||
text = value;
|
||||
elseif isstring(value)
|
||||
text = strjoin(cellstr(value), ', ');
|
||||
elseif isnumeric(value) || islogical(value)
|
||||
text = mat2str(value);
|
||||
elseif iscell(value)
|
||||
pieces = cellfun(@valueText, value, 'UniformOutput', false);
|
||||
text = ['{' strjoin(pieces, ', ') '}'];
|
||||
else
|
||||
try
|
||||
text = jsonencode(value);
|
||||
catch
|
||||
text = ['<' class(value) '>'];
|
||||
end
|
||||
end
|
||||
text = regexprep(text, '[\r\n\t]+', ' ');
|
||||
end
|
||||
@@ -0,0 +1,111 @@
|
||||
function inspect_targeted_diagnostics
|
||||
% Targeted read-only diagnostics for signal mapping and thermal parameters.
|
||||
|
||||
rootDir = fileparts(mfilename('fullpath'));
|
||||
modelDir = fullfile(rootDir, 'LEM_slx');
|
||||
reportFile = fullfile(rootDir, 'analysis_artifacts', 'targeted_diagnostics.txt');
|
||||
addpath(modelDir);
|
||||
fid = fopen(reportFile, 'w');
|
||||
cleanup = onCleanup(@() fclose(fid));
|
||||
|
||||
models = {'PMLSM', 'PMLSM_ThreeNodeThermal'};
|
||||
for k = 1:numel(models)
|
||||
model = models{k};
|
||||
load_system(fullfile(modelDir, [model '.slx']));
|
||||
fprintf(fid, '=== MODEL %s ===\n', model);
|
||||
callbackNames = {'PreLoadFcn','PostLoadFcn','InitFcn','StartFcn','StopFcn','CloseFcn'};
|
||||
for n = 1:numel(callbackNames)
|
||||
fprintf(fid, 'CALLBACK\t%s\t%s\n', callbackNames{n}, ...
|
||||
oneLine(get_param(model, callbackNames{n})));
|
||||
end
|
||||
fprintf(fid, 'DATA_DICTIONARY\t%s\n', get_param(model, 'DataDictionary'));
|
||||
|
||||
rootBlocks = find_system(model, 'SearchDepth', 1, 'Type', 'Block');
|
||||
fprintf(fid, 'ROOT_BLOCKS\n');
|
||||
for n = 1:numel(rootBlocks)
|
||||
fprintf(fid, '%s\t%s\t%s\n', rootBlocks{n}, ...
|
||||
get_param(rootBlocks{n}, 'BlockType'), get_param(rootBlocks{n}, 'MaskType'));
|
||||
end
|
||||
dumpLines(fid, model);
|
||||
|
||||
if strcmp(model, 'PMLSM_ThreeNodeThermal')
|
||||
ws = get_param(model, 'ModelWorkspace');
|
||||
exprBlocks = find_system(model, 'LookUnderMasks', 'all', 'FollowLinks', 'off', ...
|
||||
'BlockType', 'Gain');
|
||||
fprintf(fid, 'RESOLVED_GAINS\n');
|
||||
for n = 1:numel(exprBlocks)
|
||||
expr = get_param(exprBlocks{n}, 'Gain');
|
||||
fprintf(fid, '%s\t%s\t', exprBlocks{n}, expr);
|
||||
try
|
||||
fprintf(fid, 'slResolve=%s\t', oneLine(valueText(slResolve(expr, exprBlocks{n}))));
|
||||
catch ME
|
||||
fprintf(fid, 'slResolve_ERROR=%s\t', oneLine(ME.message));
|
||||
end
|
||||
try
|
||||
fprintf(fid, 'modelWorkspace=%s\n', oneLine(valueText(evalin(ws, expr))));
|
||||
catch ME
|
||||
fprintf(fid, 'modelWorkspace_ERROR=%s\n', oneLine(ME.message));
|
||||
end
|
||||
end
|
||||
|
||||
constants = find_system([model '/Pcu'], 'SearchDepth', 1, 'BlockType', 'Constant');
|
||||
fprintf(fid, 'RESOLVED_PCU_CONSTANTS\n');
|
||||
for n = 1:numel(constants)
|
||||
expr = get_param(constants{n}, 'Value');
|
||||
fprintf(fid, '%s\t%s\t', constants{n}, expr);
|
||||
try
|
||||
fprintf(fid, '%s\n', oneLine(valueText(slResolve(expr, constants{n}))));
|
||||
catch ME
|
||||
fprintf(fid, 'ERROR=%s\n', oneLine(ME.message));
|
||||
end
|
||||
end
|
||||
end
|
||||
close_system(model, 0);
|
||||
fprintf(fid, '\n');
|
||||
end
|
||||
|
||||
clear cleanup
|
||||
end
|
||||
|
||||
function dumpLines(fid, system)
|
||||
fprintf(fid, 'PORT_MAP\t%s\n', system);
|
||||
systems = [{system}; find_system(system, 'LookUnderMasks', 'all', ...
|
||||
'FollowLinks', 'off', 'BlockType', 'SubSystem')];
|
||||
systems = unique(systems, 'stable');
|
||||
for n = 1:numel(systems)
|
||||
lines = find_system(systems{n}, 'FindAll', 'on', 'SearchDepth', 1, 'Type', 'Line');
|
||||
lines = unique(lines);
|
||||
for p = 1:numel(lines)
|
||||
srcPort = get_param(lines(p), 'SrcPortHandle');
|
||||
dstPorts = get_param(lines(p), 'DstPortHandle');
|
||||
if srcPort > 0
|
||||
srcBlock = get_param(srcPort, 'Parent');
|
||||
srcNumber = get_param(srcPort, 'PortNumber');
|
||||
for q = 1:numel(dstPorts)
|
||||
if dstPorts(q) > 0
|
||||
dstBlock = get_param(dstPorts(q), 'Parent');
|
||||
dstNumber = get_param(dstPorts(q), 'PortNumber');
|
||||
fprintf(fid, '%s\t%s:%d -> %s:%d\n', systems{n}, ...
|
||||
srcBlock, srcNumber, dstBlock, dstNumber);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function text = valueText(value)
|
||||
if ischar(value)
|
||||
text = value;
|
||||
elseif isstring(value)
|
||||
text = strjoin(cellstr(value), ', ');
|
||||
elseif isnumeric(value) || islogical(value)
|
||||
text = mat2str(value);
|
||||
else
|
||||
text = ['<' class(value) '>'];
|
||||
end
|
||||
end
|
||||
|
||||
function text = oneLine(text)
|
||||
text = regexprep(char(text), '[\r\n\t]+', ' ');
|
||||
end
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
Ansys Electronics Desktop Version 2025.2.0, Build: 2025-05-16 12:03:40
|
||||
Location: F:\Program Files\ANSYS Inc\v252\AnsysEM\ansysedt.exe
|
||||
Batch Script: F:/codex_proj/LEM_Simulink/probe_aedt_project.py
|
||||
Starting Batch Run: 6:24:27 PM Aug 26, 2026
|
||||
Running as user : DESKTOP-2OB6FNE\Duang
|
||||
Temp directory: C:\Users\Duang\AppData\Local\Temp
|
||||
Project directory: C:\Users\Duang\Documents\Ansoft
|
||||
[error] TypeErrorException: makedirs() got an unexpected keyword argument 'exist_ok'
|
||||
In file "F:/codex_proj/LEM_Simulink/probe_aedt_project.py", line 8 ---- While executing script: F:/codex_proj/LEM_Simulink/probe_aedt_project.py
|
||||
[error] Error executing script in F:/codex_proj/LEM_Simulink/probe_aedt_project.py:
|
||||
Stopping Batch Run: 6:24:32 PM Aug 26, 2026
|
||||
|
||||
Ansys Electronics Desktop Version 2025.2.0, Build: 2025-05-16 12:03:40
|
||||
Location: F:\Program Files\ANSYS Inc\v252\AnsysEM\ansysedt.exe
|
||||
Batch Script: F:/codex_proj/LEM_Simulink/probe_aedt_project.py
|
||||
Starting Batch Run: 6:25:20 PM Aug 26, 2026
|
||||
Running as user : DESKTOP-2OB6FNE\Duang
|
||||
Temp directory: C:\Users\Duang\AppData\Local\Temp
|
||||
Project directory: C:\Users\Duang\Documents\Ansoft
|
||||
[error] Error in command execution
|
||||
Stopping Batch Run: 6:25:26 PM Aug 26, 2026
|
||||
|
||||
Ansys Electronics Desktop Version 2025.2.0, Build: 2025-05-16 12:03:40
|
||||
Location: F:\Program Files\ANSYS Inc\v252\AnsysEM\ansysedt.exe
|
||||
Batch Script: F:/codex_proj/LEM_Simulink/probe_aedt_project.py
|
||||
Starting Batch Run: 6:26:09 PM Aug 26, 2026
|
||||
Running as user : DESKTOP-2OB6FNE\Duang
|
||||
Temp directory: C:\Users\Duang\AppData\Local\Temp
|
||||
Project directory: C:\Users\Duang\Documents\Ansoft
|
||||
Stopping Batch Run: 6:26:16 PM Aug 26, 2026
|
||||
@@ -0,0 +1,64 @@
|
||||
import os
|
||||
import traceback
|
||||
|
||||
|
||||
workspace = r"F:\codex_proj\LEM_Simulink"
|
||||
project_file = os.path.join(workspace, "LinearSimulink.aedt")
|
||||
report_file = os.path.join(workspace, "analysis_artifacts", "aedt_project_probe.txt")
|
||||
if not os.path.isdir(os.path.dirname(report_file)):
|
||||
os.makedirs(os.path.dirname(report_file))
|
||||
|
||||
|
||||
def write_line(handle, label, value=""):
|
||||
handle.write("{}\t{}\n".format(label, value))
|
||||
handle.flush()
|
||||
|
||||
|
||||
with open(report_file, "w") as report:
|
||||
try:
|
||||
write_line(report, "PROJECT_FILE", project_file)
|
||||
write_line(report, "PROJECT_EXISTS", os.path.isfile(project_file))
|
||||
|
||||
project = oDesktop.OpenProject(project_file)
|
||||
write_line(report, "OPEN_PROJECT_RETURN", project)
|
||||
if project is None:
|
||||
project = oDesktop.SetActiveProject("LinearSimulink")
|
||||
write_line(report, "ACTIVE_PROJECT", project.GetName())
|
||||
|
||||
try:
|
||||
write_line(report, "TOP_DESIGNS", project.GetTopDesignList())
|
||||
except Exception as exc:
|
||||
write_line(report, "TOP_DESIGNS_ERROR", repr(exc))
|
||||
|
||||
design = project.SetActiveDesign("Simplorer2")
|
||||
write_line(report, "ACTIVE_DESIGN", design.GetName())
|
||||
write_line(report, "DESIGN_TYPE", design.GetDesignType())
|
||||
|
||||
try:
|
||||
setup_module = design.GetModule("SimSetup")
|
||||
write_line(report, "SETUPS", setup_module.GetSetups())
|
||||
except Exception as exc:
|
||||
write_line(report, "SETUPS_ERROR", repr(exc))
|
||||
|
||||
try:
|
||||
editor = design.SetActiveEditor("SchematicEditor")
|
||||
write_line(report, "EDITOR", editor)
|
||||
write_line(report, "ALL_ELEMENTS", editor.GetAllElements())
|
||||
except Exception as exc:
|
||||
write_line(report, "EDITOR_ERROR", repr(exc))
|
||||
|
||||
try:
|
||||
messages = oDesktop.GetMessages("LinearSimulink", "Simplorer2", 0)
|
||||
write_line(report, "MESSAGES", messages)
|
||||
except Exception as exc:
|
||||
write_line(report, "MESSAGES_ERROR", repr(exc))
|
||||
|
||||
write_line(report, "PROBE_STATUS", "PASS")
|
||||
project.Close()
|
||||
except Exception:
|
||||
write_line(report, "PROBE_STATUS", "FAIL")
|
||||
write_line(report, "TRACEBACK", traceback.format_exc())
|
||||
try:
|
||||
write_line(report, "DESKTOP_MESSAGES", oDesktop.GetMessages("", "", 0))
|
||||
except Exception as message_exc:
|
||||
write_line(report, "DESKTOP_MESSAGES_ERROR", repr(message_exc))
|
||||
@@ -0,0 +1,64 @@
|
||||
function probe_ansoft_integration
|
||||
% Probe the installed Ansys Twin Builder S-function with the PMLSM model.
|
||||
|
||||
projectDir = fileparts(mfilename('fullpath'));
|
||||
modelDir = fullfile(projectDir, 'LEM_slx');
|
||||
modelFile = fullfile(modelDir, 'PMLSM.slx');
|
||||
projectFile = fullfile(projectDir, 'LinearSimulink.aedt');
|
||||
ansysEmRoot = getenv('ANSYSEM_ROOT252');
|
||||
ansoftMatlabDir = fullfile(ansysEmRoot, 'cpl', 'matlab', 'r2024a');
|
||||
|
||||
assert(isfolder(ansoftMatlabDir), ...
|
||||
'The AEDT MATLAB interface directory does not exist: %s', ansoftMatlabDir);
|
||||
|
||||
addpath(modelDir);
|
||||
addpath(ansoftMatlabDir, '-begin');
|
||||
rehash;
|
||||
|
||||
load_system(modelFile);
|
||||
closeModel = onCleanup(@() close_system('PMLSM', 0));
|
||||
blockPath = 'PMLSM/S-Function';
|
||||
storedUserData = get_param(blockPath, 'UserData');
|
||||
oldProjectFile = 'F:\Matlab_proj\LinearSimulink.aedt';
|
||||
activeUserData = strrep(storedUserData, oldProjectFile, projectFile);
|
||||
assert(~strcmp(storedUserData, activeUserData), ...
|
||||
'Expected legacy project path was not found in the S-Function UserData.');
|
||||
set_param(blockPath, 'UserData', activeUserData, 'UserDataPersistent', 'on');
|
||||
|
||||
fprintf('MATLAB_VERSION\t%s\n', version);
|
||||
fprintf('MEX_EXTENSION\t%s\n', mexext);
|
||||
fprintf('ANSYSEM_ROOT252\t%s\n', ansysEmRoot);
|
||||
fprintf('ANSOFT_MATLAB_DIR\t%s\n', ansoftMatlabDir);
|
||||
fprintf('ANSOFT_SFUNCTION\t%s\n', which('AnsoftSFunction'));
|
||||
fprintf('ANSOFT_LINK_DIALOG\t%s\n', which('AnsoftLinkDialog'));
|
||||
fprintf('ANSOFT_SFUNCTION_EXIST\t%d\n', exist('AnsoftSFunction', 'file'));
|
||||
fprintf('STORED_PROJECT\t%s\n', oldProjectFile);
|
||||
fprintf('ACTIVE_PROJECT\t%s\n', projectFile);
|
||||
|
||||
in = Simulink.SimulationInput('PMLSM');
|
||||
in = in.setModelParameter('StopTime', '0.001', 'SimulationMode', 'normal');
|
||||
try
|
||||
out = sim(in);
|
||||
catch ME
|
||||
fprintf('SIMULATION_STATUS\tFAIL\n');
|
||||
fprintf('ERROR_ID\t%s\n', ME.identifier);
|
||||
fprintf('ERROR_CODEPOINTS\t%s\n', strjoin(string(double(ME.message)), ','));
|
||||
couplingVars = {'Simulink_Coupling_Error', ...
|
||||
'Simulink_Coupling_InstanceName', 'DSDEActiveDesignName'};
|
||||
for k = 1:numel(couplingVars)
|
||||
varName = couplingVars{k};
|
||||
if evalin('base', sprintf('exist(''%s'', ''var'')', varName))
|
||||
value = evalin('base', varName);
|
||||
fprintf('BASE_VAR\t%s\t%s\n', varName, string(value));
|
||||
end
|
||||
end
|
||||
errorFile = fullfile(projectDir, 'analysis_artifacts', 'ansoft_probe_error.txt');
|
||||
fid = fopen(errorFile, 'w', 'n', 'UTF-8');
|
||||
fprintf(fid, '%s\n', getReport(ME, 'extended', 'hyperlinks', 'off'));
|
||||
fclose(fid);
|
||||
rethrow(ME);
|
||||
end
|
||||
|
||||
fprintf('SIMULATION_STATUS\tPASS\n');
|
||||
fprintf('SIMULATION_OUTPUTS\t%s\n', strjoin(who(out), ', '));
|
||||
end
|
||||
@@ -0,0 +1,64 @@
|
||||
function probe_ansys_official_example
|
||||
% Run the Ansys-installed Simulink coupling example as a control test.
|
||||
|
||||
projectDir = fileparts(mfilename('fullpath'));
|
||||
artifactDir = fullfile(projectDir, 'analysis_artifacts');
|
||||
cacheDir = fullfile(artifactDir, 'ansys_example_cache');
|
||||
codeDir = fullfile(artifactDir, 'ansys_example_codegen');
|
||||
if ~isfolder(artifactDir)
|
||||
mkdir(artifactDir);
|
||||
end
|
||||
if ~isfolder(cacheDir)
|
||||
mkdir(cacheDir);
|
||||
end
|
||||
if ~isfolder(codeDir)
|
||||
mkdir(codeDir);
|
||||
end
|
||||
|
||||
ansysEmRoot = getenv('ANSYSEM_ROOT252');
|
||||
ansoftMatlabDir = fullfile(ansysEmRoot, 'cpl', 'matlab', 'r2024a');
|
||||
exampleDir = fullfile(ansysEmRoot, 'Examples', 'Twin Builder', ...
|
||||
'Components', 'Interfaces', 'Simulink');
|
||||
modelFile = fullfile(exampleDir, 'synchronous_drive.mdl');
|
||||
projectFile = fullfile(exampleDir, 'simulink.aedt');
|
||||
|
||||
assert(isfile(modelFile), 'Official example model not found: %s', modelFile);
|
||||
assert(isfile(projectFile), 'Official example project not found: %s', projectFile);
|
||||
assert(isfolder(ansoftMatlabDir), 'Ansys MATLAB interface not found: %s', ansoftMatlabDir);
|
||||
|
||||
addpath(ansoftMatlabDir, '-begin');
|
||||
addpath(exampleDir, '-begin');
|
||||
rehash;
|
||||
Simulink.fileGenControl('set', 'CacheFolder', cacheDir, ...
|
||||
'CodeGenFolder', codeDir, 'createDir', true);
|
||||
|
||||
fprintf('CONTROL_MODEL\t%s\n', modelFile);
|
||||
fprintf('CONTROL_PROJECT\t%s\n', projectFile);
|
||||
fprintf('ANSOFT_SFUNCTION\t%s\n', which('AnsoftSFunction'));
|
||||
|
||||
in = Simulink.SimulationInput('synchronous_drive');
|
||||
in = in.setModelParameter('SimulationMode', 'normal');
|
||||
try
|
||||
out = sim(in);
|
||||
catch ME
|
||||
fprintf('CONTROL_STATUS\tFAIL\n');
|
||||
fprintf('ERROR_ID\t%s\n', ME.identifier);
|
||||
couplingVars = {'Simulink_Coupling_Error', ...
|
||||
'Simulink_Coupling_InstanceName', 'DSDEActiveDesignName'};
|
||||
for k = 1:numel(couplingVars)
|
||||
varName = couplingVars{k};
|
||||
if evalin('base', sprintf('exist(''%s'', ''var'')', varName))
|
||||
value = evalin('base', varName);
|
||||
fprintf('BASE_VAR\t%s\t%s\n', varName, string(value));
|
||||
end
|
||||
end
|
||||
errorFile = fullfile(artifactDir, 'ansys_official_example_error.txt');
|
||||
fid = fopen(errorFile, 'w', 'n', 'UTF-8');
|
||||
fprintf(fid, '%s\n', getReport(ME, 'extended', 'hyperlinks', 'off'));
|
||||
fclose(fid);
|
||||
rethrow(ME);
|
||||
end
|
||||
|
||||
fprintf('CONTROL_STATUS\tPASS\n');
|
||||
fprintf('CONTROL_OUTPUTS\t%s\n', strjoin(who(out), ', '));
|
||||
end
|
||||
@@ -0,0 +1,44 @@
|
||||
function verify_pmlsm_ansys_integration
|
||||
% Verify the persisted PMLSM-to-AEDT integration without manual path setup.
|
||||
|
||||
projectDir = fileparts(mfilename('fullpath'));
|
||||
modelDir = fullfile(projectDir, 'LEM_slx');
|
||||
modelFile = fullfile(modelDir, 'PMLSM.slx');
|
||||
artifactDir = fullfile(projectDir, 'analysis_artifacts');
|
||||
cacheDir = fullfile(artifactDir, 'pmlsm_verify_cache');
|
||||
codeDir = fullfile(artifactDir, 'pmlsm_verify_codegen');
|
||||
if ~isfolder(cacheDir)
|
||||
mkdir(cacheDir);
|
||||
end
|
||||
if ~isfolder(codeDir)
|
||||
mkdir(codeDir);
|
||||
end
|
||||
|
||||
addpath(modelDir, '-begin');
|
||||
Simulink.fileGenControl('set', 'CacheFolder', cacheDir, ...
|
||||
'CodeGenFolder', codeDir, 'createDir', true);
|
||||
|
||||
fprintf('ANSOFT_BEFORE_LOAD\t%s\n', which('AnsoftSFunction'));
|
||||
load_system(modelFile);
|
||||
closeModel = onCleanup(@() close_system('PMLSM', 0));
|
||||
fprintf('PERSISTED_USER_DATA\t%s\n', get_param('PMLSM/S-Function', 'UserData'));
|
||||
fprintf('PERSISTED_INIT_FCN\t%s\n', get_param('PMLSM', 'InitFcn'));
|
||||
|
||||
in = Simulink.SimulationInput('PMLSM');
|
||||
in = in.setModelParameter('StopTime', '0.001', 'SimulationMode', 'normal');
|
||||
try
|
||||
out = sim(in);
|
||||
catch ME
|
||||
fprintf('VERIFY_STATUS\tFAIL\n');
|
||||
fprintf('ERROR_ID\t%s\n', ME.identifier);
|
||||
if evalin('base', 'exist(''Simulink_Coupling_Error'', ''var'')')
|
||||
fprintf('COUPLING_ERROR\t%s\n', ...
|
||||
string(evalin('base', 'Simulink_Coupling_Error')));
|
||||
end
|
||||
rethrow(ME);
|
||||
end
|
||||
|
||||
fprintf('ANSOFT_AFTER_INIT\t%s\n', which('AnsoftSFunction'));
|
||||
fprintf('VERIFY_STATUS\tPASS\n');
|
||||
fprintf('VERIFY_OUTPUTS\t%s\n', strjoin(who(out), ', '));
|
||||
end
|
||||
Reference in New Issue
Block a user