How do I add a node to a simscape custom component?

5 views (last 30 days)
I am building a custom component, I would like to create an internal thermal node inside of the component, what is the best way to do this?
Right now I have to create a node on the outside of the part
Is there any way to create nodes from the library? Or do I need to create variables? I have also tried creating a node from a variable, but that also did not work
I am working from this example:
but in this example they are using a domain. I am unsure of how to integrate a domain into a component.
Again my question is how do I create a non-visible node inside of a custom component?
nodes %conserving ports
p = foundation.electrical.electrical; % +:top
n = foundation.electrical.electrical; % -:bottom
Th = foundation.thermal.thermal; % H:top
Tc = foundation.thermal.thermal; % C:bottom
Tm = foundation.thermal.thermal; % M:bottom
dTmax = {63, 'K'}; % DeltaT Max constant from datasheet
Km = {0 , 'W/K'}; % Thermal conductivity
Rm = {0 , 'Ohm'}; % Resistivity
function setup
qE = {value={0,'J/s'},priority=priority.low};
qR = {value={0,'J/s'},priority=priority.low};
qS1 = {value={0,'J/s'},priority=priority.low};
qS2 = {value={0,'J/s'},priority=priority.low};
Th.T = {value={0,'K'},priority=priority.low};
Tc.T = {value={0,'K'},priority=priority.low};
Tm.T = {value={0,'K'},priority=priority.low};
% Parameter validation.
i : p.i -> n.i;
qR : * -> Tm.Q; %This is for self heating, its a heat source from ground
qS1 : Tc.Q -> Tm.Q;
qS2 : Tm.Q -> Th.Q;
qE : Tc.Q -> Th.Q;
qR == Rm * i * i;
qS1 == (Tc.T - Tm.T)*Km/2;
qS2 == (Tm.T - Th.T)*Km/2;

Accepted Answer

Steven on 28 Feb 2018
Edited: Steven on 28 Feb 2018
Figured it out, you do it this way
Tm = foundation.thermal.thermal;

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!