Why do simscape components not use branches?

조회 수: 3 (최근 30일)
Steven
Steven 2018년 2월 28일
편집: Steven 2018년 2월 28일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Thermal Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by