Why do simscape components not use branches?

2 views (last 30 days)
Steven
Steven on 28 Feb 2018
Edited: Steven on 28 Feb 2018
If I create my own custom component, I need to use a branch
component conduction < foundation.thermal.branch
% Conductive Heat Transfer
% This block models heat transfer in a thermal network by conduction
% through a layer of material. The rate of heat transfer is governed by
% Fourier's law and is proportional to the temperature difference, material
% thermal conductivity, area normal to the heat flow direction, and
% inversely proportional to the layer thickness.
% Copyright 2005-2016 The MathWorks, Inc.
parameters
area = {1e-4, 'm^2' }; % Area
thickness = {0.1, 'm' }; % Thickness
th_cond = {401, 'W/(m*K)'}; % Thermal conductivity
end
equations
assert(area > 0)
assert(thickness > 0)
assert(th_cond > 0)
Q == T * area * th_cond / thickness;
end
This is what I think the equivalent would be in a custom component.
component customconduction
% CustomConductive Heat Transfer
nodes %conserving ports
Th = foundation.thermal.thermal; % H:top
Tc = foundation.thermal.thermal; % C:bottom
end
parameters
area = {1e-4, 'm^2' }; % Area
thickness = {0.1, 'm' }; % Thickness
th_cond = {401, 'W/(m*K)'}; % Thermal conductivity
end
variables(Access=private)
Qheat = { 0, 'J/s' };% heat flux
end
branches
Qheat : Tc.Q -> Th.Q;
end
equations
assert(area > 0)
assert(thickness > 0)
assert(th_cond > 0)
Qheat == (Tc.T - Th.T) * area * th_cond / thickness;
end
end
Why do non custom components not need to use branches? Is this correct in the way I have written this component? The simscape documentation is lacking in examples.

Answers (0)

Community Treasure Hunt

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

Start Hunting!