I'm trying to write a custom thermal component, the basis of which is formed by two thermally conductive elements. The component compiles but I get this error when I try and run it.
Number of equations exceeds number of variables. Click on any Simscape blocks identified below for more detailed diagnostics.
component thermalresistivenet3
nodes
Th = foundation.thermal.thermal;
Tc = foundation.thermal.thermal;
end
nodes(Access=private)
Tm = foundation.thermal.thermal;
end
parameters
Tini = {273, 'K'};
Km = {20, 'W/K'};
end
variables(Access=private)
qS1 = { 0, 'J/s' };
qS2 = { 0, 'J/s' };
end
function setup
qS1 = {value={0,'J/s'},priority=priority.low};
qS2 = {value={0,'J/s'},priority=priority.low};
Th.T = {value=Tini,priority=priority.high};
Tc.T = {value=Tini,priority=priority.high};
Tm.T = {value=Tini,priority=priority.high};
end
branches
qS1 : Tc.Q -> Tm.Q;
qS2 : Tm.Q -> Th.Q;
end
equations
assert(Th.T > 0)
assert(Tc.T > 0)
assert(Tm.T > 0)
qS1 == (Tc.T - Tm.T)*Km/2;
qS2 == (Tm.T - Th.T)*Km/2;
qS2 == qS1;
end
end
In my mind this is a very simple thermal system. I want to write much more complicated thermal systems such as peltier devices. How do I model this system correctly?
Edit, if I remove the heat flow from the equation and set the equations equal to each other, I also run into a problem:
(Tc.T - Tm.T)*Km/2 == (Tm.T - Th.T)*Km/2;
Number of variables exceeds number of equations. Click on any Simscape blocks identified below for more detailed diagnostics. ThermalStackPeltierDebugsinglev2/thermalresistivenet3