simscape variable thermal mass - initial condition issue

5 visualizaciones (últimos 30 días)
Benoit Laveau
Benoit Laveau el 5 de Feb. de 2021
Respondida: Juan Sagarduy el 9 de Mzo. de 2021
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

Respuestas (1)

Juan Sagarduy
Juan Sagarduy el 9 de Mzo. de 2021
Hello Benoit,
It seems strange. Have you got the chance to share the files?
BR/Juan

Categorías

Más información sobre Foundation and Custom Domains en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by