У меня есть один блок «Thermal Mass» в Simulink, который представляет собой тепловую массу, которая является способностью материала или комбинации материалов для хранения внутренней энергии. В этом стандартном блоке Simulink необходимо ввести начальную температуру. К блоку можно подключить только один сигнал. Исходный код блока выглядит следующим образом:Simulink - сборка компонентов заказчика
component mass
% Thermal Mass
% The block represents a thermal mass, which is the ability of a material
% or combination of materials to store internal energy. The property is
% characterized by mass of the material and its specific heat.
%
% The block has one thermal conserving port.
% The block positive direction is from its port towards the block. This
% means that the heat flow is positive if it flows into the block.
% Copyright 2005-2013 The MathWorks, Inc.
nodes
M = foundation.thermal.thermal; % :top
end
parameters
mass = { 1, 'kg' }; % Mass
sp_heat = { 447, 'J/(kg*K)' }; % Specific heat
end
variables
Q = { 0, 'J/s' }; % Heat flow
end
variables(Conversion=absolute)
T = { 300, 'K' }; % Temperature
end
function setup
% Parameter range checking
if mass <= 0
pm_error('simscape:GreaterThanZero','Mass')
end
if sp_heat <= 0
pm_error('simscape:GreaterThanZero','Specific heat')
end
end
branches
Q : M.Q -> *;
end
equations
T == M.T;
Q == mass * sp_heat * T.der;
assert(T>0, 'Temperature must be greater than absolute zero')
end
end
Я хотел бы построить еще один компонент, у которого начальной температура может исходить от другого блока, так что он может быть также рассчитан где-то в другом месте. Таким образом, один входной параметр и все остальное должны быть одинаковыми. Я новичок в Simulink и мало знаю о доменах. Любая идея, как это можно сделать?
Спасибо!
Я все еще не знаю, как это сделать. – Huve