Clear Filters
Clear Filters

Error message, Equations of one or more components may be dependent or inconsistent in simscape model.

10 views (last 30 days)
component bilinear_model
nodes
r = foundation.mechanical.translational.translational;
c = foundation.mechanical.translational.translational;
end
parameters
k1 = {1800000,'N/m'};
k2 = {600000,'N/m'};
dy = {0.0053,'m'};
ft = {5500,'N/m'};
fy = {9540,'N'};
un = 1;
tau = {1,'s'};
u0 = {0,'m'};
end
variables
x = {value = { 0, 'm'}, priority = priority.high}; % Deformation
f = {0,'N'};
v = {0,'m/s'};
d_upper = {0,'m'};
d_lower = {0,'m'};
x0 = {0,'m'};
f0 = {0,'N'};
end
branches
f : r.f -> c.f;
end
equations
d_upper == 1/(k1-k2)*(k1*x0-f0-k2*fy/k1+fy);
d_lower == 1/(k1-k2)*(k1*x0-f0+k2*fy/k1-fy);
if x < d_lower
f == k2*(x+(fy/k1))-fy;
elseif x > d_upper
f == k2*(x-(fy/k1))+fy;
else
f == k1*(x-x0)+f0;
end
v == r.v-c.v;
v == x.der;
x0 == x;
f0 == f;
end
end
I specify the bilinear spring in simscape block, to simulate the bilinear specimen.
When I connect to the hydralic system and run, I got the error message.
This is the bilienar model in Matlab bleow, it works perfectly.
function [obj,f1] = dispLoad_bilinear(obj,d1)
k1 = obj(1);
k2 = obj(2);
dy = obj(3);
d0 = obj(4);
f0 = obj(5);
status = obj(6);
fy = obj(7);
% 1) Intersecting x Coordiates
d_upper = 1/(k1-k2)*(k1*d0-f0-k2*fy/k1+fy);
d_lower = 1/(k1-k2)*(k1*d0-f0+k2*fy/k1-fy);
% 2) Determination of x1
if d1<d_lower
f1 = k2*(d1+fy/k1)-fy;
obj(6) = 2;
elseif d1>d_upper
f1 = k2*(d1-fy/k1)+fy;
obj(6) = 2;
else
f1 = k1*(d1-d0)+f0;
end
obj(4) = d1;
obj(5) = f1;

Answers (1)

Anurag Ojha
Anurag Ojha on 2 Feb 2024
Hello Huang
The cause of error “Steady state solve failed to converge” could be due to the algebraic loops in your model.
To detect them, please go to Configuration Parameters >> Diagnostics and set Algebraic Loop to 'error'. That will point to the block is causing it.
To solve it, you can place a Unit Delay block in the feedback to the block that is causing the error.
Also, try unchecking the "start simulation from steady state" box under Solver Configuration block.
I hope this helps you to resolve the error!

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!