# simscape variable thermal mass - initial condition issue

조회 수: 13(최근 30일)
Benoit Laveau 2021년 2월 5일
답변: Juan Sagarduy 2021년 3월 9일
Hi everyone,
I have created a custom component representing a thermal mass, which mass is varying based on an input.
when I compare the results of a constant mass via the default simscape block and my custom block, the initial conditions are different, however the same initial temperature is specified. anyone experiencing the same issue? how can this be solved?
cheers
Benoit here is the custom block code
component mass_custom
% Thermal Mass
% This block models internal energy storage in a thermal network. The rate
% of temperature increase is proportional to the heat flow rate into the
% material and inversely proportioanl to the mass and specific heat of the
% material.
% Copyright 2005-2016 The MathWorks, Inc.
inputs
S = {1, 'kg'}; % S:top
end
nodes
M = foundation.thermal.thermal; % :top
end
parameters
% mass_cu = {1, 'kg' }; % Mass Copper
% mass_iron = {1, 'kg' }; % Mass Stator Iron
sp_heat = {447, 'J/(kg*K)'}; % Specific heat
end
variables
% Differential variables
T = {value = {290, 'K'}, priority = priority.high}; % Temperature
Q = {0, 'W'}; % Heat flow rate
end
branches
Q : M.Q -> *;
end
equations
assert(S > 0)
assert(sp_heat > 0)
T == M.T;
Q == S * sp_heat * T.der;
assert(T > 0, 'Temperature must be greater than absolute zero')
end
end

댓글을 달려면 로그인하십시오.

### 답변(1개)

Juan Sagarduy 2021년 3월 9일
Hello Benoit,
It seems strange. Have you got the chance to share the files?
BR/Juan

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

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

Start Hunting!