Error compiling Simscape network for model: Number of variables exceeds number of equations.
1 Comment
Accepted Answer
2 Comments
More Answers (1)
Hy i have the same error in the component of mass.
this is the code: nodes M = foundation.thermal.thermal; % :top end
parameters mass = { 1000, 'kg' };
sp_heat = { 447, 'J/(kg*K)' }; % Specific heat end
variables % Differential variables T = {value = {300, 'K'}}; % Temperature
Q = { 0, 'J/s' }; % Heat flow end
function setup %#simple % 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
and this is the error message
['HEV_SeriesParallel/Electrical/System Level/DC-DC Converter/Thermal Model/Thermal Mass']: Type mismatch for equation. The left hand side of the equation is {[1x1 double], 'C'} and the right hand side of the equation is {[1x1 double], 'K'}. T = {[1x1 double], 'C'} M.T = {[1x1 double], 'K'} In foundation.thermal.elements.mass (line 45)
0 Comments
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!