フィルターのクリア

Error compiling Simscape network for model: Number of variables exceeds number of equations.

32 ビュー (過去 30 日間)
I have modified copy of spring.ssc file from Simscape foundation->translational library, and tried to model simple system but I am getting the error."Number of variables exceeds number of equations", How to identify consistency of equations with variables from available model, and used .ssc files? Some insights I want. Even if you share link containing the information, it will be helpful.
Thanks in advance!
component nspring
% Non-linear Spring
% Behavior is force proportional to square of deformation
nodes
r = foundation.mechanical.translational.translational; % r:right
c = foundation.mechanical.translational.translational; % c:left
end
parameters
k = { 1, 'N/(m*m)' }; % Spring constant
end
variables
v = { 0, 'm/s' }; % Velocity
f = { 0, 'N' }; % Force
x = { 0, 'm' }; % Deformation
end
function setup
if k <= 0
error('k cannot be less than zero')
end
end
branches
f : r.f -> c.f;
end
equations
v == r.v-c.v;
f == k*x*x;
end
end
  1 件のコメント
lilly michel
lilly michel 2017 年 7 月 19 日
When I use simulink to compile the battery model, the following problems always occur: Error compiling Simscape network for model ssc_lithium_cell_2RC_TEST. Caused by: Unable to compile the physical network. Bother me for a long time, hope to get your guidance

サインインしてコメントする。

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 9 月 9 日
Yep, you have 3 variables (force, deformation, velocity) but only 2 equations.
The missing one I believe is the one relating the deformation and velocity using the "der" keyword.
v == x.der;
- Sebastian
  2 件のコメント
Yogesh Badhe
Yogesh Badhe 2015 年 9 月 10 日
Thank you very much.
Sebastian Castro
Sebastian Castro 2015 年 9 月 10 日
No problem... also, if you want to make a quadratic spring, you may want the equation to handle the sign of the deformation:
f == k*x*abs(x);
- Sebastian

サインインしてコメントする。

その他の回答 (1 件)

aymen
aymen 2018 年 4 月 21 日

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)

カテゴリ

Help Center および File ExchangeRun-Time Parameters についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by